home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / pine / pine.h < prev    next >
C/C++ Source or Header  |  1997-02-26  |  110KB  |  2,715 lines

  1. /*----------------------------------------------------------------------
  2.   $Id: pine.h,v 4.459 1996/07/11 18:15:24 mikes Exp $
  3.  
  4.             T H E    P I N E    M A I L   S Y S T E M
  5.  
  6.    Laurence Lundblade and Mike Seibel
  7.    Networks and Distributed Computing
  8.    Computing and Communications
  9.    University of Washington
  10.    Administration Builiding, AG-44
  11.    Seattle, Washington, 98195, USA
  12.    Internet: lgl@CAC.Washington.EDU
  13.              mikes@CAC.Washington.EDU
  14.  
  15.    Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  16.  
  17.  
  18.    Pine and Pico are registered trademarks of the University of Washington.
  19.    No commercial use of these trademarks may be made without prior written
  20.    permission of the University of Washington.
  21.  
  22.    Pine, Pico, and Pilot software and its included text are Copyright
  23.    1989-1997 by the University of Washington.
  24.  
  25.    The full text of our legal notices is contained in the file called
  26.    CPYRIGHT, included with this distribution.
  27.  
  28.  
  29.    USENET News reading additions in part by L Lundblade / NorthWestNet, 1993
  30.    lgl@nwnet.net
  31.  
  32.    Pine is in part based on The Elm Mail System:
  33.     ***********************************************************************
  34.     *  The Elm Mail System  -  Revision: 2.13                             *
  35.     *                                                                     *
  36.     *             Copyright (c) 1986, 1987 Dave Taylor              *
  37.     *             Copyright (c) 1988, 1989 USENET Community Trust   *
  38.     ***********************************************************************
  39.  
  40.  
  41.   ----------------------------------------------------------------------*/
  42.  
  43. /*======================================================================
  44.  
  45.      pine.h 
  46.  
  47.      Definitions here are fundamental to pine. 
  48.  
  49.     No changes should need to be made here to configure pine for one
  50.   site or another.  That is, no changes for local preferences such as
  51.   default directories and other parameters.  Changes might be needed here
  52.   for porting pine to a new machine, but we hope not.
  53.  
  54.    Includes
  55.      - Various convenience definitions and macros
  56.      - macros for debug printfs
  57.      - data structures used by Pine
  58.      - declarations of all Pine functions
  59.  
  60.   ====*/
  61.  
  62.  
  63. #ifndef _PINE_INCLUDED
  64. #define _PINE_INCLUDED
  65.  
  66. #define PINE_VERSION        "3.96"
  67. #define    PHONE_HOME_VERSION    "396"
  68. #define    PHONE_HOME_HOST        "docserver.cac.washington.edu"
  69. #define    UPDATE_FOLDER        "{pine.cac.washington.edu:144/anonymous}#news."
  70.  
  71.  
  72. #define BREAK        '\0'          /* default interrupt    */
  73. #define BACKSPACE    '\b'         /* backspace character  */
  74. #define TAB        '\t'            /* tab character        */
  75. #define RETURN        '\r'         /* carriage return char */
  76. #define LINE_FEED    '\n'         /* line feed character  */
  77. #define FORMFEED    '\f'         /* form feed (^L) char  */
  78. #define COMMA        ','        /* comma character      */
  79. #define SPACE        ' '        /* space character      */
  80. #define DOT        '.'        /* period/dot character */
  81. #define BANG        '!'        /* exclaimation mark!   */
  82. #define AT_SIGN        '@'        /* at-sign character    */
  83. #define PERCENT        '%'        /* percent sign char.   */
  84. #define COLON        ':'        /* the colon ..        */
  85. #define BACKQUOTE    '`'        /* backquote character  */
  86. #define TILDE_ESCAPE    '~'        /* escape character~    */
  87. #define ESCAPE        '\033'        /* the escape        */
  88. #define    BELL        '\007'        /* the bell        */
  89. #define LPAREN        '('
  90. #define RPAREN        ')'
  91. #define BSLASH        '\\'
  92. #define QUOTE        '"'
  93.  
  94. #if defined(DOS) || defined(OS2)
  95. #define    NEWLINE        "\r\n"        /* local EOL convention...  */
  96. #else
  97. #define    NEWLINE        "\n"        /* necessary for gf_* funcs */
  98. #endif
  99.  
  100. #ifndef TRUE
  101. #define TRUE        1
  102. #define FALSE        0
  103. #endif
  104.  
  105.  
  106. #define EXECUTE_ACCESS    01        /* These five are        */
  107. #define WRITE_ACCESS    02        /*    for the calls       */
  108. #define READ_ACCESS    04        /*       to access()       */
  109. #define ACCESS_EXISTS    00        /*           <etc>         */
  110. #define EDIT_ACCESS    06        /*  (this is r+w access)   */
  111.  
  112. #define    FM_DO_PRINT    0x01        /* flag for format_message */
  113. #define    FM_NEW_MESS    0x02        /* ditto           */
  114. #define    FM_DO_PGP    0x04        /* ditto           */
  115.  
  116. #define    RB_NORM        0x00        /* flags modifying radio_buttons */
  117. #define    RB_ONE_TRY    0x01        /* one shot answer, else default */
  118. #define    RB_FLUSH_IN    0x02        /* discard pending input     */
  119. #define    RB_NO_NEWMAIL    0x04        /* Quell new mail check         */
  120.  
  121. #define    GF_NOOP        0x01        /* flags used by generalized */
  122. #define GF_EOD        0x02        /* filters                   */
  123. #define GF_DATA        0x04        /* See filter.c for more     */
  124. #define GF_ERROR    0x08        /* details                   */
  125. #define GF_RESET    0x10
  126.  
  127.  
  128. /*
  129.  * Size of generic filter's input/output queue
  130.  */
  131. #define    GF_MAXBUF        256
  132.  
  133.  
  134. #define KEY_HELP_LEN   (2 * MAX_SCREEN_COLS)
  135.                           /*When saving escape sequences, etc length of string
  136.                                 for the usual key menu at the bottom. used with
  137.                                 begin_output_store(), end_output_store() */
  138.  
  139.  
  140. #undef  min
  141. #define min(a,b)    ((a) < (b) ? (a) : (b))
  142. #undef  max
  143. #define max(a,b)    ((a) > (b) ? (a) : (b))
  144. #define ctrl(c)            ((c) & 0x1f)    /* control character mapping */
  145. #define plural(n)    ((n) == 1 ? "" : "s")
  146.  
  147. /*
  148.  * Macro to simplify clearing body portion of pine's display
  149.  */
  150. #define ClearBody()    ClearLines(1, ps_global->ttyo->screen_rows           \
  151.                           - FOOTER_ROWS(ps_global) - 1)
  152.  
  153. /*
  154.  * Macro to reveal horizontal scroll margin.  It can be no greater than
  155.  * half the number of lines on the display...
  156.  */
  157. #define    HS_MAX_MARGIN(p)    (((p)->ttyo->screen_rows-FOOTER_ROWS(p)-3)/2)
  158. #define    HS_MARGIN(p)        min((p)->scroll_margin, HS_MAX_MARGIN(p))
  159.  
  160.  
  161. /*
  162.  * Macros to support anything you'd ever want to do with a message
  163.  * number...
  164.  */
  165. #define    mn_init(P, m)        msgno_init((P), (m))
  166.  
  167. #define    mn_get_cur(p)        (((p) && (p)->select)                   \
  168.                   ? (p)->select[(p)->sel_cur] : -1)
  169.  
  170. #define    mn_set_cur(p, m)    {                          \
  171.                   if(p){                      \
  172.                     (p)->select[(p)->sel_cur] = (m);          \
  173.                   }                          \
  174.                 }
  175.  
  176. #define    mn_inc_cur(s, p)    msgno_inc(s, p)
  177.  
  178. #define    mn_dec_cur(s, p)    msgno_dec(s, p)
  179.  
  180. #define    mn_add_cur(p, m)    {                          \
  181.                   if(p){                      \
  182.                       if((p)->sel_cnt+1L > (p)->sel_size){    \
  183.                       (p)->sel_size += 10L;              \
  184.                       fs_resize((void **)&((p)->select),  \
  185.                             (size_t)(p)->sel_size     \
  186.                                      * sizeof(long)); \
  187.                       }                          \
  188.                       (p)->select[((p)->sel_cnt)++] = (m);    \
  189.                   }                          \
  190.                 }
  191.  
  192. #define    mn_total_cur(p)        ((p) ? (p)->sel_cnt : 0L)
  193.  
  194. #define    mn_first_cur(p)        (((p) && (p)->sel_cnt > 0L)              \
  195.                   ? (p)->select[(p)->sel_cur = 0] : 0L)
  196.  
  197. #define    mn_next_cur(p)        (((p) && ((p)->sel_cur + 1) < (p)->sel_cnt)   \
  198.                   ? (p)->select[++((p)->sel_cur)] : -1L)
  199.  
  200. #define    mn_is_cur(p, m)        msgno_in_select((p), (m))
  201.  
  202. #define    mn_reset_cur(p, m)    {                          \
  203.                   if(p){                      \
  204.                       (p)->sel_cur  = 0L;              \
  205.                       (p)->sel_cnt  = 1L;              \
  206.                       (p)->sel_size = 8L;              \
  207.                       fs_resize((void **)&((p)->select),      \
  208.                     (size_t)(p)->sel_size * sizeof(long));\
  209.                       (p)->select[0] = (m);              \
  210.                   }                          \
  211.                     }
  212.  
  213. #define    mn_m2raw(p, m)        (((p) && (p)->sort && (m) > 0               \
  214.                   && (m) <= mn_get_total(p))               \
  215.                    ? (p)->sort[m] : 0L)
  216.  
  217. #define    mn_raw2m(p, m)        msgno_in_sort((p), (m))
  218.  
  219. #define    mn_get_total(p)        ((p) ? (p)->max_msgno : 0L)
  220.  
  221. #define    mn_set_total(p, m)    {                          \
  222.                   if(p)                          \
  223.                     (p)->max_msgno = (m);              \
  224.                     }
  225.  
  226. #define    mn_add_raw(p, m)    msgno_add_raw((p), (m))
  227.  
  228. #define    mn_flush_raw(p, m)    msgno_flush_raw((p), (m))
  229.  
  230. #define    mn_get_sort(p)        ((p) ? (p)->sort_order : SortArrival)
  231.  
  232. #define    mn_set_sort(p, t)    {                          \
  233.                   if(p)                          \
  234.                     (p)->sort_order = (t);              \
  235.                 }
  236.  
  237. #define    mn_get_revsort(p)    ((p) ? (p)->reverse_sort : 0)
  238.  
  239. #define    mn_set_revsort(p, t)    {                          \
  240.                   if(p)                          \
  241.                     (p)->reverse_sort = (t);              \
  242.                 }
  243.  
  244. #define    mn_give(P)        {                          \
  245.                   if(P){                      \
  246.                       if((*(P))->sort)                  \
  247.                     fs_give((void **)&((*(P))->sort));    \
  248.                       if((*(P))->select)              \
  249.                     fs_give((void **)&((*(P))->select));  \
  250.                       fs_give((void **)(P));              \
  251.                   }                          \
  252.                 }
  253.  
  254. /*
  255.  * This searchs for lines beginning with From<space> so that we can QP-encode
  256.  * them.  It also searches for lines consisting of only a dot.  Some mailers
  257.  * will mangle these lines.  The reason it is ifdef'd is because most people
  258.  * seem to prefer the >From style escape provided by a lot of mail software
  259.  * to the QP-encoding.
  260.  * Froms, dots, bmap, and dmap may be any integer type.  C is the next char.
  261.  * bmap and dmap should be initialized to 1.
  262.  * froms is incremented by 1 whenever a line beginning From_ is found.
  263.  * dots is incremented by 1 whenever a line with only a dot is found.
  264.  */
  265. #define Find_Froms(froms,dots,bmap,dmap,c) { int x,y;            \
  266.                 switch (c) {                \
  267.                   case '\n': case '\r':            \
  268.                     x = 0x1;                \
  269.                     y = 0x7;                \
  270.                     bmap = 0;                \
  271.                     break;                \
  272.                   case 'F':                \
  273.                     x = 0x3;                \
  274.                     y = 0;                \
  275.                     break;                \
  276.                   case 'r':                \
  277.                     x = 0x7;                \
  278.                     y = 0;                \
  279.                     break;                \
  280.                   case 'o':                \
  281.                     x = 0xf;                \
  282.                     y = 0;                \
  283.                     break;                \
  284.                   case 'm':                \
  285.                     x = 0x1f;                \
  286.                     y = 0;                \
  287.                     break;                \
  288.                   case ' ':                \
  289.                     x = 0x3f;                \
  290.                     y = 0;                \
  291.                     break;                \
  292.                   case '.':                \
  293.                     x = 0;                \
  294.                     y = 0x3;                \
  295.                     break;                \
  296.                   default:                \
  297.                     x = 0;                \
  298.                     y = 0;                \
  299.                     break;                \
  300.                 }                    \
  301.                 bmap = ((x >> 1) == bmap) ? x : 0;    \
  302.                 froms += (bmap == 0x3f ? 1 : 0);    \
  303.                 if(y == 0x7 && dmap != 0x3){        \
  304.                     y = 0x1;                \
  305.                     dmap = 0;                \
  306.                 }                    \
  307.                 dmap = ((y >> 1) == dmap) ? y : 0;    \
  308.                 dots += (dmap == 0x7 ? 1 : 0);        \
  309.                  }
  310.  
  311. /*
  312.  * Useful macro to test if current folder is a bboard type (meaning
  313.  * netnews for now) collection...
  314.  */
  315. #define    IS_NEWS(S)    (ps_global->nr_mode                     \
  316.              || ((S) && (S)->mailbox && (S)->mailbox[0] == '*'))
  317.  
  318. #define    READONLY_FOLDER  (ps_global->mail_stream                  \
  319.               && ((ps_global->mail_stream->rdonly             \
  320.                    && !IS_NEWS(ps_global->mail_stream))         \
  321.                   || ps_global->mail_stream->anonymous))
  322.  
  323. /*
  324.  * Simple, handy macro to determine if folder name is remote 
  325.  * (on an imap server)
  326.  */
  327. #define    IS_REMOTE(X)    (*(X) == '{' && *((X) + 1) && *((X) + 1) != '}' \
  328.              && strchr(((X) + 2), '}'))
  329.  
  330.  
  331. /*
  332.  * Macro used to fetch all flags.  Used when counting deleted messages
  333.  * and finding next message with a particular flag set.  The idea is to
  334.  * minimize the number of times we have to fetch all of the flags for all
  335.  * messages in the folder.
  336.  */
  337. #define    FETCH_ALL_FLAGS(s) {long i;                          \
  338.                 if(s == ps_global->mail_stream){              \
  339.                 i = max(ps_global->last_msgno_flagged,1L);    \
  340.                 ps_global->last_msgno_flagged = s->nmsgs;     \
  341.                 }                              \
  342.                 else                          \
  343.                   i = 1L;                          \
  344.                                           \
  345.                 if(i < s->nmsgs){                      \
  346.                 char         sequence[16];              \
  347.                                           \
  348.                 sprintf(sequence,"%ld:%ld", i, s->nmsgs);     \
  349.                 mail_fetchflags(s, sequence);              \
  350.                 }                              \
  351.                }
  352.  
  353.  
  354. /*======================================================================
  355.         Key code definitions
  356.   ===*/
  357. #define PF1           0x0100
  358. #define PF2           0x0101
  359. #define PF3           0x0102
  360. #define PF4           0x0103
  361. #define PF5           0x0104
  362. #define PF6           0x0105
  363. #define PF7           0x0106
  364. #define PF8           0x0107
  365. #define PF9           0x0108
  366. #define PF10          0x0109
  367. #define PF11          0x010A
  368. #define PF12          0x010B
  369.       
  370. #define OPF1          0x0110
  371. #define OPF2          0x0111
  372. #define OPF3          0x0112
  373. #define OPF4          0x0113
  374. #define OPF5          0x0114
  375. #define OPF6          0x0115
  376. #define OPF7          0x0116
  377. #define OPF8          0x0117
  378. #define OPF9          0x0118
  379. #define OPF10         0x0119
  380. #define OPF11         0x011A
  381. #define OPF12         0x011B
  382.  
  383. #define OOPF1          0x0120
  384. #define OOPF2          0x0121
  385. #define OOPF3          0x0122
  386. #define OOPF4          0x0123
  387. #define OOPF5          0x0124
  388. #define OOPF6          0x0125
  389. #define OOPF7          0x0126
  390. #define OOPF8          0x0127
  391. #define OOPF9          0x0128
  392. #define OOPF10         0x0129
  393. #define OOPF11         0x012A
  394. #define OOPF12         0x012B
  395.  
  396. #define OOOPF1         0x0130
  397. #define OOOPF2         0x0131
  398. #define OOOPF3         0x0132
  399. #define OOOPF4         0x0133
  400. #define OOOPF5         0x0134
  401. #define OOOPF6         0x0135
  402. #define OOOPF7         0x0136
  403. #define OOOPF8         0x0137
  404. #define OOOPF9         0x0138
  405. #define OOOPF10        0x0139
  406. #define OOOPF11        0x013A
  407. #define OOOPF12        0x013B
  408.  
  409. #define PF2OPF(x)      (x + 0x10)
  410. #define PF2OOPF(x)     (x + 0x20)
  411. #define PF2OOOPF(x)    (x + 0x30)
  412.  
  413.  
  414. /*-- some control codes for arrow keys.. see read_char */
  415. #define KEY_UP        0x0140
  416. #define KEY_DOWN    0x0141
  417. #define KEY_RIGHT    0x0142
  418. #define KEY_LEFT    0x0143
  419. #define KEY_JUNK    0x0144
  420. #define KEY_RESIZE    0x0145  /* Fake key to cause resize */
  421. #define    KEY_HOME    0x0146  /* Extras that aren't used outside DOS */
  422. #define    KEY_END        0x0147
  423. #define    KEY_PGUP    0x0148
  424. #define    KEY_PGDN    0x0149
  425. #define    KEY_DEL        0x014A
  426. #define    KEY_MOUSE    0x014B  /* Fake key to indicate mouse event. */
  427. #define KEY_SCRLTO    0x014C
  428. #define KEY_SCRLUPL    0x014D
  429. #define KEY_SCRLDNL    0x014E
  430. #define KEY_SWALLOW_Z    0x014F
  431. #define KEY_SWAL_UP    0x0150    /* mirror KEY_UP etc. order found above */
  432. #define KEY_SWAL_DOWN    0x0151
  433. #define KEY_SWAL_RIGHT    0x0152
  434. #define KEY_SWAL_LEFT    0x0153
  435. #define KEY_DOUBLE_ESC    0x0154
  436. #define KEY_KERMIT    0x0155
  437. #define KEY_XTERM_MOUSE    0x0156
  438.  
  439. #define NO_OP_COMMAND    '\0'    /* no-op for short timeouts   */
  440. #define NO_OP_IDLE    0x0200  /* no-op for timeouts > 25 seconds  */
  441. #define READY_TO_READ    0x0201
  442. #define KEY_MENU_FLAG    0x1000
  443. #define KEY_MASK    0x13FF
  444.  
  445. /*
  446.  * Macro to help with new mail check timing...
  447.  */
  448. #define    NM_TIMING(X)  (((X)==NO_OP_IDLE) ? 0 : ((X)==NO_OP_COMMAND) ? 1 : 2)
  449.  
  450.  
  451. /*
  452.  * The array is initialized in init.c so the order of that initialization
  453.  * must correspond to the order of the values here.  The order is
  454.  * significant in that it determines the order that the variables
  455.  * are written into the pinerc file.
  456.  */
  457. #define V_PERSONAL_NAME            0
  458. #define V_USER_ID                  1
  459. #define V_USER_DOMAIN              2
  460. #define V_SMTP_SERVER              3
  461. #define V_NNTP_SERVER              4
  462. #define V_INBOX_PATH               5
  463. #define V_INCOMING_FOLDERS         6
  464. #define V_FOLDER_SPEC              7
  465. #define V_NEWS_SPEC                8
  466. #define    V_ARCHIVED_FOLDERS       9
  467. #define    V_PRUNED_FOLDERS       10
  468. #define V_DEFAULT_FCC              11
  469. #define V_DEFAULT_SAVE_FOLDER      12
  470. #define V_POSTPONED_FOLDER         13
  471. #define V_MAIL_DIRECTORY           14
  472. #define V_READ_MESSAGE_FOLDER      15
  473. #define V_SIGNATURE_FILE           16
  474. #define V_GLOB_ADDRBOOK            17
  475. #define V_ADDRESSBOOK              18
  476. #define V_FEATURE_LIST             19
  477. #define V_INIT_CMD_LIST            20
  478. #define V_COMP_HDRS                21
  479. #define V_CUSTOM_HDRS              22
  480. #define V_VIEW_HEADERS             23
  481. #define V_SAVED_MSG_NAME_RULE      24
  482. #define V_FCC_RULE                 25
  483. #define V_SORT_KEY                 26
  484. #define V_AB_SORT_RULE             27
  485. #define    V_GOTO_DEFAULT_RULE       28
  486. #define V_CHAR_SET                 29
  487. #define V_EDITOR                   30
  488. #define V_SPELLER                  31
  489. #define V_FILLCOL                  32
  490. #define V_REPLY_STRING             33
  491. #define V_EMPTY_HDR_MSG            34
  492. #define V_IMAGE_VIEWER             35
  493. #define V_USE_ONLY_DOMAIN_NAME     36
  494. #define V_PRINTER                  37
  495. #define V_PERSONAL_PRINT_COMMAND   38
  496. #define V_PERSONAL_PRINT_CATEGORY  39
  497. #define V_STANDARD_PRINTER         40
  498. #define V_LAST_TIME_PRUNE_QUESTION 41
  499. #define V_LAST_VERS_USED           42
  500. #define V_BUGS_FULLNAME            43
  501. #define V_BUGS_ADDRESS             44
  502. #define V_BUGS_EXTRAS              45
  503. #define V_SUGGEST_FULLNAME         46
  504. #define V_SUGGEST_ADDRESS          47
  505. #define V_LOCAL_FULLNAME           48
  506. #define V_LOCAL_ADDRESS            49
  507. #define V_FORCED_ABOOK_ENTRY       50
  508. #define V_KBLOCK_PASSWD_COUNT      51
  509. #define    V_SENDMAIL_PATH           52
  510. #define    V_OPER_DIR           53
  511. #define    V_DISPLAY_FILTERS       54
  512. #define    V_SEND_FILTER           55
  513. #define    V_ALT_ADDRS           56
  514. #define    V_ABOOK_FORMATS           57
  515. #define    V_INDEX_FORMAT           58
  516. #define    V_OVERLAP           59
  517. #define    V_MARGIN           60
  518. #define V_STATUS_MSG_DELAY       61
  519. #define    V_MAILCHECK           62
  520. #define    V_NEWSRC_PATH           63
  521. #define    V_NEWS_ACTIVE_PATH       64
  522. #define    V_NEWS_SPOOL_DIR       65
  523. #define    V_UPLOAD_CMD           66
  524. #define    V_UPLOAD_CMD_PREFIX       67
  525. #define    V_DOWNLOAD_CMD           68
  526. #define    V_DOWNLOAD_CMD_PREFIX       69
  527. #define    V_MAILCAP_PATH           70
  528. #define    V_MIMETYPE_PATH           71
  529. #define    V_TCPOPENTIMEO           72
  530. #define    V_RSHOPENTIMEO           73
  531. #define    V_NEW_VER_QUELL           74
  532.  
  533. #ifdef    NEWBB
  534. #define V_NNTP_NEW_GROUP_TIME      75
  535. #define    V_LAST_REGULAR_VAR       75
  536. #else
  537. #define    V_LAST_REGULAR_VAR       74
  538. #endif
  539. #define V_ELM_STYLE_SAVE           (V_LAST_REGULAR_VAR + 1)  /* obsolete */
  540. #define V_HEADER_IN_REPLY          (V_LAST_REGULAR_VAR + 2)  /* obsolete */
  541. #define V_FEATURE_LEVEL            (V_LAST_REGULAR_VAR + 3)  /* obsolete */
  542. #define V_OLD_STYLE_REPLY          (V_LAST_REGULAR_VAR + 4)  /* obsolete */
  543. #define V_COMPOSE_MIME             (V_LAST_REGULAR_VAR + 5)  /* obsolete */
  544. #define V_SHOW_ALL_CHARACTERS      (V_LAST_REGULAR_VAR + 6)  /* obsolete */
  545. #define V_SAVE_BY_SENDER           (V_LAST_REGULAR_VAR + 7)  /* obsolete */
  546. #if defined(DOS) || defined(OS2)
  547. #define V_FOLDER_EXTENSION         (V_LAST_REGULAR_VAR + 8)
  548. #define V_NORM_FORE_COLOR          (V_LAST_REGULAR_VAR + 9)
  549. #define V_NORM_BACK_COLOR          (V_LAST_REGULAR_VAR + 10)
  550. #define V_REV_FORE_COLOR           (V_LAST_REGULAR_VAR + 11)
  551. #define V_REV_BACK_COLOR           (V_LAST_REGULAR_VAR + 12)
  552. #ifdef    _WINDOWS
  553. #define V_FONT_NAME           (V_LAST_REGULAR_VAR + 13)
  554. #define V_FONT_SIZE           (V_LAST_REGULAR_VAR + 14)
  555. #define V_FONT_STYLE           (V_LAST_REGULAR_VAR + 15)
  556. #define V_PRINT_FONT_NAME       (V_LAST_REGULAR_VAR + 16)
  557. #define V_PRINT_FONT_SIZE       (V_LAST_REGULAR_VAR + 17)
  558. #define V_PRINT_FONT_STYLE       (V_LAST_REGULAR_VAR + 18)
  559. #define V_WINDOW_POSITION       (V_LAST_REGULAR_VAR + 19)
  560. #define    V_LAST_VAR           (V_LAST_REGULAR_VAR + 19)
  561. #else   /* !_WINDOWS */
  562. #define    V_LAST_VAR           (V_LAST_REGULAR_VAR + 12)
  563. #endif  /* _WINDOWS */
  564. #else   /* !DOS */
  565. #define    V_LAST_VAR           (V_LAST_REGULAR_VAR + 7)
  566. #endif  /* DOS */
  567.  
  568.  
  569. #define VAR_PERSONAL_NAME         vars[V_PERSONAL_NAME].current_val.p
  570. #define USR_PERSONAL_NAME         vars[V_PERSONAL_NAME].user_val.p
  571. #define GLO_PERSONAL_NAME         vars[V_PERSONAL_NAME].global_val.p
  572. #define FIX_PERSONAL_NAME         vars[V_PERSONAL_NAME].fixed_val.p
  573. #define COM_PERSONAL_NAME         vars[V_PERSONAL_NAME].cmdline_val.p
  574. #define VAR_USER_ID             vars[V_USER_ID].current_val.p
  575. #define USR_USER_ID             vars[V_USER_ID].user_val.p
  576. #define GLO_USER_ID             vars[V_USER_ID].global_val.p
  577. #define FIX_USER_ID             vars[V_USER_ID].fixed_val.p
  578. #define COM_USER_ID             vars[V_USER_ID].cmdline_val.p
  579. #define VAR_USER_DOMAIN             vars[V_USER_DOMAIN].current_val.p
  580. #define USR_USER_DOMAIN             vars[V_USER_DOMAIN].user_val.p
  581. #define GLO_USER_DOMAIN             vars[V_USER_DOMAIN].global_val.p
  582. #define FIX_USER_DOMAIN             vars[V_USER_DOMAIN].fixed_val.p
  583. #define COM_USER_DOMAIN             vars[V_USER_DOMAIN].cmdline_val.p
  584. #define VAR_SMTP_SERVER             vars[V_SMTP_SERVER].current_val.l
  585. #define USR_SMTP_SERVER             vars[V_SMTP_SERVER].user_val.l
  586. #define GLO_SMTP_SERVER             vars[V_SMTP_SERVER].global_val.l
  587. #define FIX_SMTP_SERVER             vars[V_SMTP_SERVER].fixed_val.l
  588. #define COM_SMTP_SERVER             vars[V_SMTP_SERVER].cmdline_val.l
  589. #define VAR_INBOX_PATH             vars[V_INBOX_PATH].current_val.p
  590. #define USR_INBOX_PATH             vars[V_INBOX_PATH].user_val.p
  591. #define GLO_INBOX_PATH             vars[V_INBOX_PATH].global_val.p
  592. #define FIX_INBOX_PATH             vars[V_INBOX_PATH].fixed_val.p
  593. #define COM_INBOX_PATH             vars[V_INBOX_PATH].cmdline_val.p
  594. #define VAR_INCOMING_FOLDERS         vars[V_INCOMING_FOLDERS].current_val.l
  595. #define USR_INCOMING_FOLDERS         vars[V_INCOMING_FOLDERS].user_val.l
  596. #define GLO_INCOMING_FOLDERS         vars[V_INCOMING_FOLDERS].global_val.l
  597. #define FIX_INCOMING_FOLDERS         vars[V_INCOMING_FOLDERS].fixed_val.l
  598. #define COM_INCOMING_FOLDERS         vars[V_INCOMING_FOLDERS].cmdline_val.l
  599. #define VAR_FOLDER_SPEC             vars[V_FOLDER_SPEC].current_val.l
  600. #define USR_FOLDER_SPEC             vars[V_FOLDER_SPEC].user_val.l
  601. #define GLO_FOLDER_SPEC             vars[V_FOLDER_SPEC].global_val.l
  602. #define FIX_FOLDER_SPEC             vars[V_FOLDER_SPEC].fixed_val.l
  603. #define COM_FOLDER_SPEC             vars[V_FOLDER_SPEC].cmdline_val.l
  604. #define VAR_NEWS_SPEC             vars[V_NEWS_SPEC].current_val.l
  605. #define USR_NEWS_SPEC             vars[V_NEWS_SPEC].user_val.l
  606. #define GLO_NEWS_SPEC             vars[V_NEWS_SPEC].global_val.l
  607. #define FIX_NEWS_SPEC             vars[V_NEWS_SPEC].fixed_val.l
  608. #define COM_NEWS_SPEC             vars[V_NEWS_SPEC].cmdline_val.l
  609. #define VAR_ARCHIVED_FOLDERS         vars[V_ARCHIVED_FOLDERS].current_val.l
  610. #define USR_ARCHIVED_FOLDERS         vars[V_ARCHIVED_FOLDERS].user_val.l
  611. #define GLO_ARCHIVED_FOLDERS         vars[V_ARCHIVED_FOLDERS].global_val.l
  612. #define FIX_ARCHIVED_FOLDERS         vars[V_ARCHIVED_FOLDERS].fixed_val.l
  613. #define COM_ARCHIVED_FOLDERS         vars[V_ARCHIVED_FOLDERS].cmdline_val.l
  614. #define VAR_PRUNED_FOLDERS         vars[V_PRUNED_FOLDERS].current_val.l
  615. #define USR_PRUNED_FOLDERS         vars[V_PRUNED_FOLDERS].user_val.l
  616. #define GLO_PRUNED_FOLDERS         vars[V_PRUNED_FOLDERS].global_val.l
  617. #define FIX_PRUNED_FOLDERS         vars[V_PRUNED_FOLDERS].fixed_val.l
  618. #define COM_PRUNED_FOLDERS         vars[V_PRUNED_FOLDERS].cmdline_val.l
  619. #define VAR_DEFAULT_FCC             vars[V_DEFAULT_FCC].current_val.p
  620. #define USR_DEFAULT_FCC             vars[V_DEFAULT_FCC].user_val.p
  621. #define GLO_DEFAULT_FCC             vars[V_DEFAULT_FCC].global_val.p
  622. #define FIX_DEFAULT_FCC             vars[V_DEFAULT_FCC].fixed_val.p
  623. #define COM_DEFAULT_FCC             vars[V_DEFAULT_FCC].cmdline_val.p
  624. #define VAR_DEFAULT_SAVE_FOLDER         vars[V_DEFAULT_SAVE_FOLDER].current_val.p
  625. #define USR_DEFAULT_SAVE_FOLDER         vars[V_DEFAULT_SAVE_FOLDER].user_val.p
  626. #define GLO_DEFAULT_SAVE_FOLDER         vars[V_DEFAULT_SAVE_FOLDER].global_val.p
  627. #define FIX_DEFAULT_SAVE_FOLDER         vars[V_DEFAULT_SAVE_FOLDER].fixed_val.p
  628. #define COM_DEFAULT_SAVE_FOLDER         vars[V_DEFAULT_SAVE_FOLDER].cmdline_val.p
  629. #define VAR_POSTPONED_FOLDER         vars[V_POSTPONED_FOLDER].current_val.p
  630. #define USR_POSTPONED_FOLDER         vars[V_POSTPONED_FOLDER].user_val.p
  631. #define GLO_POSTPONED_FOLDER         vars[V_POSTPONED_FOLDER].global_val.p
  632. #define FIX_POSTPONED_FOLDER         vars[V_POSTPONED_FOLDER].fixed_val.p
  633. #define COM_POSTPONED_FOLDER         vars[V_POSTPONED_FOLDER].cmdline_val.p
  634. #define VAR_MAIL_DIRECTORY         vars[V_MAIL_DIRECTORY].current_val.p
  635. #define USR_MAIL_DIRECTORY         vars[V_MAIL_DIRECTORY].user_val.p
  636. #define GLO_MAIL_DIRECTORY         vars[V_MAIL_DIRECTORY].global_val.p
  637. #define FIX_MAIL_DIRECTORY         vars[V_MAIL_DIRECTORY].fixed_val.p
  638. #define COM_MAIL_DIRECTORY         vars[V_MAIL_DIRECTORY].cmdline_val.p
  639. #define VAR_READ_MESSAGE_FOLDER         vars[V_READ_MESSAGE_FOLDER].current_val.p
  640. #define USR_READ_MESSAGE_FOLDER         vars[V_READ_MESSAGE_FOLDER].user_val.p
  641. #define GLO_READ_MESSAGE_FOLDER         vars[V_READ_MESSAGE_FOLDER].global_val.p
  642. #define FIX_READ_MESSAGE_FOLDER         vars[V_READ_MESSAGE_FOLDER].fixed_val.p
  643. #define COM_READ_MESSAGE_FOLDER         vars[V_READ_MESSAGE_FOLDER].cmdline_val.p
  644. #define VAR_SIGNATURE_FILE         vars[V_SIGNATURE_FILE].current_val.p
  645. #define USR_SIGNATURE_FILE         vars[V_SIGNATURE_FILE].user_val.p
  646. #define GLO_SIGNATURE_FILE         vars[V_SIGNATURE_FILE].global_val.p
  647. #define FIX_SIGNATURE_FILE         vars[V_SIGNATURE_FILE].fixed_val.p
  648. #define COM_SIGNATURE_FILE         vars[V_SIGNATURE_FILE].cmdline_val.p
  649. #define VAR_GLOB_ADDRBOOK         vars[V_GLOB_ADDRBOOK].current_val.l
  650. #define USR_GLOB_ADDRBOOK         vars[V_GLOB_ADDRBOOK].user_val.l
  651. #define GLO_GLOB_ADDRBOOK         vars[V_GLOB_ADDRBOOK].global_val.l
  652. #define FIX_GLOB_ADDRBOOK         vars[V_GLOB_ADDRBOOK].fixed_val.l
  653. #define COM_GLOB_ADDRBOOK         vars[V_GLOB_ADDRBOOK].cmdline_val.l
  654. #define VAR_ADDRESSBOOK             vars[V_ADDRESSBOOK].current_val.l
  655. #define USR_ADDRESSBOOK             vars[V_ADDRESSBOOK].user_val.l
  656. #define GLO_ADDRESSBOOK             vars[V_ADDRESSBOOK].global_val.l
  657. #define FIX_ADDRESSBOOK             vars[V_ADDRESSBOOK].fixed_val.l
  658. #define COM_ADDRESSBOOK             vars[V_ADDRESSBOOK].cmdline_val.l
  659. #define VAR_FEATURE_LIST         vars[V_FEATURE_LIST].current_val.l
  660. #define USR_FEATURE_LIST         vars[V_FEATURE_LIST].user_val.l
  661. #define GLO_FEATURE_LIST         vars[V_FEATURE_LIST].global_val.l
  662. #define FIX_FEATURE_LIST         vars[V_FEATURE_LIST].fixed_val.l
  663. #define COM_FEATURE_LIST         vars[V_FEATURE_LIST].cmdline_val.l
  664. #define VAR_INIT_CMD_LIST         vars[V_INIT_CMD_LIST].current_val.l
  665. #define USR_INIT_CMD_LIST         vars[V_INIT_CMD_LIST].user_val.l
  666. #define GLO_INIT_CMD_LIST         vars[V_INIT_CMD_LIST].global_val.l
  667. #define FIX_INIT_CMD_LIST         vars[V_INIT_CMD_LIST].fixed_val.l
  668. #define COM_INIT_CMD_LIST         vars[V_INIT_CMD_LIST].cmdline_val.l
  669. #define VAR_COMP_HDRS             vars[V_COMP_HDRS].current_val.l
  670. #define USR_COMP_HDRS             vars[V_COMP_HDRS].user_val.l
  671. #define GLO_COMP_HDRS             vars[V_COMP_HDRS].global_val.l
  672. #define FIX_COMP_HDRS             vars[V_COMP_HDRS].fixed_val.l
  673. #define COM_COMP_HDRS             vars[V_COMP_HDRS].cmdline_val.l
  674. #define VAR_CUSTOM_HDRS             vars[V_CUSTOM_HDRS].current_val.l
  675. #define USR_CUSTOM_HDRS             vars[V_CUSTOM_HDRS].user_val.l
  676. #define GLO_CUSTOM_HDRS             vars[V_CUSTOM_HDRS].global_val.l
  677. #define FIX_CUSTOM_HDRS             vars[V_CUSTOM_HDRS].fixed_val.l
  678. #define COM_CUSTOM_HDRS             vars[V_CUSTOM_HDRS].cmdline_val.l
  679. #define VAR_VIEW_HEADERS         vars[V_VIEW_HEADERS].current_val.l
  680. #define USR_VIEW_HEADERS         vars[V_VIEW_HEADERS].user_val.l
  681. #define GLO_VIEW_HEADERS         vars[V_VIEW_HEADERS].global_val.l
  682. #define FIX_VIEW_HEADERS         vars[V_VIEW_HEADERS].fixed_val.l
  683. #define COM_VIEW_HEADERS         vars[V_VIEW_HEADERS].cmdline_val.l
  684. #define VAR_SAVED_MSG_NAME_RULE         vars[V_SAVED_MSG_NAME_RULE].current_val.p
  685. #define USR_SAVED_MSG_NAME_RULE         vars[V_SAVED_MSG_NAME_RULE].user_val.p
  686. #define GLO_SAVED_MSG_NAME_RULE         vars[V_SAVED_MSG_NAME_RULE].global_val.p
  687. #define FIX_SAVED_MSG_NAME_RULE         vars[V_SAVED_MSG_NAME_RULE].fixed_val.p
  688. #define COM_SAVED_MSG_NAME_RULE         vars[V_SAVED_MSG_NAME_RULE].cmdline_val.p
  689. #define VAR_FCC_RULE             vars[V_FCC_RULE].current_val.p
  690. #define USR_FCC_RULE             vars[V_FCC_RULE].user_val.p
  691. #define GLO_FCC_RULE             vars[V_FCC_RULE].global_val.p
  692. #define FIX_FCC_RULE             vars[V_FCC_RULE].fixed_val.p
  693. #define COM_FCC_RULE             vars[V_FCC_RULE].cmdline_val.p
  694. #define VAR_SORT_KEY             vars[V_SORT_KEY].current_val.p
  695. #define USR_SORT_KEY             vars[V_SORT_KEY].user_val.p
  696. #define GLO_SORT_KEY             vars[V_SORT_KEY].global_val.p
  697. #define FIX_SORT_KEY             vars[V_SORT_KEY].fixed_val.p
  698. #define COM_SORT_KEY             vars[V_SORT_KEY].cmdline_val.p
  699. #define VAR_AB_SORT_RULE         vars[V_AB_SORT_RULE].current_val.p
  700. #define USR_AB_SORT_RULE         vars[V_AB_SORT_RULE].user_val.p
  701. #define GLO_AB_SORT_RULE         vars[V_AB_SORT_RULE].global_val.p
  702. #define FIX_AB_SORT_RULE         vars[V_AB_SORT_RULE].fixed_val.p
  703. #define COM_AB_SORT_RULE         vars[V_AB_SORT_RULE].cmdline_val.p
  704. #define VAR_CHAR_SET             vars[V_CHAR_SET].current_val.p
  705. #define USR_CHAR_SET             vars[V_CHAR_SET].user_val.p
  706. #define GLO_CHAR_SET             vars[V_CHAR_SET].global_val.p
  707. #define FIX_CHAR_SET             vars[V_CHAR_SET].fixed_val.p
  708. #define COM_CHAR_SET             vars[V_CHAR_SET].cmdline_val.p
  709. #define VAR_EDITOR             vars[V_EDITOR].current_val.p
  710. #define USR_EDITOR             vars[V_EDITOR].user_val.p
  711. #define GLO_EDITOR             vars[V_EDITOR].global_val.p
  712. #define FIX_EDITOR             vars[V_EDITOR].fixed_val.p
  713. #define COM_EDITOR             vars[V_EDITOR].cmdline_val.p
  714. #define VAR_SPELLER             vars[V_SPELLER].current_val.p
  715. #define USR_SPELLER             vars[V_SPELLER].user_val.p
  716. #define GLO_SPELLER             vars[V_SPELLER].global_val.p
  717. #define FIX_SPELLER             vars[V_SPELLER].fixed_val.p
  718. #define COM_SPELLER             vars[V_SPELLER].cmdline_val.p
  719. #define VAR_FILLCOL             vars[V_FILLCOL].current_val.p
  720. #define USR_FILLCOL             vars[V_FILLCOL].user_val.p
  721. #define GLO_FILLCOL             vars[V_FILLCOL].global_val.p
  722. #define FIX_FILLCOL             vars[V_FILLCOL].fixed_val.p
  723. #define COM_FILLCOL             vars[V_FILLCOL].cmdline_val.p
  724. #define VAR_REPLY_STRING         vars[V_REPLY_STRING].current_val.p
  725. #define USR_REPLY_STRING         vars[V_REPLY_STRING].user_val.p
  726. #define GLO_REPLY_STRING         vars[V_REPLY_STRING].global_val.p
  727. #define FIX_REPLY_STRING         vars[V_REPLY_STRING].fixed_val.p
  728. #define COM_REPLY_STRING         vars[V_REPLY_STRING].cmdline_val.p
  729. #define VAR_EMPTY_HDR_MSG         vars[V_EMPTY_HDR_MSG].current_val.p
  730. #define USR_EMPTY_HDR_MSG         vars[V_EMPTY_HDR_MSG].user_val.p
  731. #define GLO_EMPTY_HDR_MSG         vars[V_EMPTY_HDR_MSG].global_val.p
  732. #define FIX_EMPTY_HDR_MSG         vars[V_EMPTY_HDR_MSG].fixed_val.p
  733. #define COM_EMPTY_HDR_MSG         vars[V_EMPTY_HDR_MSG].cmdline_val.p
  734. #define VAR_IMAGE_VIEWER         vars[V_IMAGE_VIEWER].current_val.p
  735. #define USR_IMAGE_VIEWER         vars[V_IMAGE_VIEWER].user_val.p
  736. #define GLO_IMAGE_VIEWER         vars[V_IMAGE_VIEWER].global_val.p
  737. #define FIX_IMAGE_VIEWER         vars[V_IMAGE_VIEWER].fixed_val.p
  738. #define COM_IMAGE_VIEWER         vars[V_IMAGE_VIEWER].cmdline_val.p
  739. #define VAR_USE_ONLY_DOMAIN_NAME     vars[V_USE_ONLY_DOMAIN_NAME].current_val.p
  740. #define USR_USE_ONLY_DOMAIN_NAME     vars[V_USE_ONLY_DOMAIN_NAME].user_val.p
  741. #define GLO_USE_ONLY_DOMAIN_NAME     vars[V_USE_ONLY_DOMAIN_NAME].global_val.p
  742. #define FIX_USE_ONLY_DOMAIN_NAME     vars[V_USE_ONLY_DOMAIN_NAME].fixed_val.p
  743. #define COM_USE_ONLY_DOMAIN_NAME     vars[V_USE_ONLY_DOMAIN_NAME].cmdline_val.p
  744. #define VAR_PRINTER             vars[V_PRINTER].current_val.p
  745. #define USR_PRINTER             vars[V_PRINTER].user_val.p
  746. #define GLO_PRINTER             vars[V_PRINTER].global_val.p
  747. #define FIX_PRINTER             vars[V_PRINTER].fixed_val.p
  748. #define COM_PRINTER             vars[V_PRINTER].cmdline_val.p
  749. #define VAR_PERSONAL_PRINT_COMMAND   vars[V_PERSONAL_PRINT_COMMAND].current_val.l
  750. #define USR_PERSONAL_PRINT_COMMAND   vars[V_PERSONAL_PRINT_COMMAND].user_val.l
  751. #define GLO_PERSONAL_PRINT_COMMAND   vars[V_PERSONAL_PRINT_COMMAND].global_val.l
  752. #define FIX_PERSONAL_PRINT_COMMAND   vars[V_PERSONAL_PRINT_COMMAND].fixed_val.l
  753. #define COM_PERSONAL_PRINT_COMMAND   vars[V_PERSONAL_PRINT_COMMAND].cmdline_val.l
  754. #define VAR_PERSONAL_PRINT_CATEGORY  vars[V_PERSONAL_PRINT_CATEGORY].current_val.p
  755. #define USR_PERSONAL_PRINT_CATEGORY  vars[V_PERSONAL_PRINT_CATEGORY].user_val.p
  756. #define GLO_PERSONAL_PRINT_CATEGORY  vars[V_PERSONAL_PRINT_CATEGORY].global_val.p
  757. #define FIX_PERSONAL_PRINT_CATEGORY  vars[V_PERSONAL_PRINT_CATEGORY].fixed_val.p
  758. #define COM_PERSONAL_PRINT_CATEGORY  vars[V_PERSONAL_PRINT_CATEGORY].cmdline_val.p
  759. #define VAR_STANDARD_PRINTER         vars[V_STANDARD_PRINTER].current_val.l
  760. #define USR_STANDARD_PRINTER         vars[V_STANDARD_PRINTER].user_val.l
  761. #define GLO_STANDARD_PRINTER         vars[V_STANDARD_PRINTER].global_val.l
  762. #define FIX_STANDARD_PRINTER         vars[V_STANDARD_PRINTER].fixed_val.l
  763. #define COM_STANDARD_PRINTER         vars[V_STANDARD_PRINTER].cmdline_val.l
  764. #define VAR_LAST_TIME_PRUNE_QUESTION vars[V_LAST_TIME_PRUNE_QUESTION].current_val.p
  765. #define USR_LAST_TIME_PRUNE_QUESTION vars[V_LAST_TIME_PRUNE_QUESTION].user_val.p
  766. #define GLO_LAST_TIME_PRUNE_QUESTION vars[V_LAST_TIME_PRUNE_QUESTION].global_val.p
  767. #define FIX_LAST_TIME_PRUNE_QUESTION vars[V_LAST_TIME_PRUNE_QUESTION].fixed_val.p
  768. #define COM_LAST_TIME_PRUNE_QUESTION vars[V_LAST_TIME_PRUNE_QUESTION].cmdline_val.p
  769. #define VAR_LAST_VERS_USED         vars[V_LAST_VERS_USED].current_val.p
  770. #define USR_LAST_VERS_USED         vars[V_LAST_VERS_USED].user_val.p
  771. #define GLO_LAST_VERS_USED         vars[V_LAST_VERS_USED].global_val.p
  772. #define FIX_LAST_VERS_USED         vars[V_LAST_VERS_USED].fixed_val.p
  773. #define COM_LAST_VERS_USED         vars[V_LAST_VERS_USED].cmdline_val.p
  774. #define VAR_BUGS_FULLNAME         vars[V_BUGS_FULLNAME].current_val.p
  775. #define USR_BUGS_FULLNAME         vars[V_BUGS_FULLNAME].user_val.p
  776. #define GLO_BUGS_FULLNAME         vars[V_BUGS_FULLNAME].global_val.p
  777. #define FIX_BUGS_FULLNAME         vars[V_BUGS_FULLNAME].fixed_val.p
  778. #define COM_BUGS_FULLNAME         vars[V_BUGS_FULLNAME].cmdline_val.p
  779. #define VAR_BUGS_ADDRESS         vars[V_BUGS_ADDRESS].current_val.p
  780. #define USR_BUGS_ADDRESS         vars[V_BUGS_ADDRESS].user_val.p
  781. #define GLO_BUGS_ADDRESS         vars[V_BUGS_ADDRESS].global_val.p
  782. #define FIX_BUGS_ADDRESS         vars[V_BUGS_ADDRESS].fixed_val.p
  783. #define COM_BUGS_ADDRESS         vars[V_BUGS_ADDRESS].cmdline_val.p
  784. #define VAR_BUGS_EXTRAS             vars[V_BUGS_EXTRAS].current_val.p
  785. #define USR_BUGS_EXTRAS             vars[V_BUGS_EXTRAS].user_val.p
  786. #define GLO_BUGS_EXTRAS             vars[V_BUGS_EXTRAS].global_val.p
  787. #define FIX_BUGS_EXTRAS             vars[V_BUGS_EXTRAS].fixed_val.p
  788. #define COM_BUGS_EXTRAS             vars[V_BUGS_EXTRAS].cmdline_val.p
  789. #define VAR_SUGGEST_FULLNAME         vars[V_SUGGEST_FULLNAME].current_val.p
  790. #define USR_SUGGEST_FULLNAME         vars[V_SUGGEST_FULLNAME].user_val.p
  791. #define GLO_SUGGEST_FULLNAME         vars[V_SUGGEST_FULLNAME].global_val.p
  792. #define FIX_SUGGEST_FULLNAME         vars[V_SUGGEST_FULLNAME].fixed_val.p
  793. #define COM_SUGGEST_FULLNAME         vars[V_SUGGEST_FULLNAME].cmdline_val.p
  794. #define VAR_SUGGEST_ADDRESS         vars[V_SUGGEST_ADDRESS].current_val.p
  795. #define USR_SUGGEST_ADDRESS         vars[V_SUGGEST_ADDRESS].user_val.p
  796. #define GLO_SUGGEST_ADDRESS         vars[V_SUGGEST_ADDRESS].global_val.p
  797. #define FIX_SUGGEST_ADDRESS         vars[V_SUGGEST_ADDRESS].fixed_val.p
  798. #define COM_SUGGEST_ADDRESS         vars[V_SUGGEST_ADDRESS].cmdline_val.p
  799. #define VAR_LOCAL_FULLNAME         vars[V_LOCAL_FULLNAME].current_val.p
  800. #define USR_LOCAL_FULLNAME         vars[V_LOCAL_FULLNAME].user_val.p
  801. #define GLO_LOCAL_FULLNAME         vars[V_LOCAL_FULLNAME].global_val.p
  802. #define FIX_LOCAL_FULLNAME         vars[V_LOCAL_FULLNAME].fixed_val.p
  803. #define COM_LOCAL_FULLNAME         vars[V_LOCAL_FULLNAME].cmdline_val.p
  804. #define VAR_LOCAL_ADDRESS         vars[V_LOCAL_ADDRESS].current_val.p
  805. #define USR_LOCAL_ADDRESS         vars[V_LOCAL_ADDRESS].user_val.p
  806. #define GLO_LOCAL_ADDRESS         vars[V_LOCAL_ADDRESS].global_val.p
  807. #define FIX_LOCAL_ADDRESS         vars[V_LOCAL_ADDRESS].fixed_val.p
  808. #define COM_LOCAL_ADDRESS         vars[V_LOCAL_ADDRESS].cmdline_val.p
  809. #define VAR_FORCED_ABOOK_ENTRY         vars[V_FORCED_ABOOK_ENTRY].current_val.l
  810. #define USR_FORCED_ABOOK_ENTRY         vars[V_FORCED_ABOOK_ENTRY].user_val.l
  811. #define GLO_FORCED_ABOOK_ENTRY         vars[V_FORCED_ABOOK_ENTRY].global_val.l
  812. #define FIX_FORCED_ABOOK_ENTRY         vars[V_FORCED_ABOOK_ENTRY].fixed_val.l
  813. #define COM_FORCED_ABOOK_ENTRY         vars[V_FORCED_ABOOK_ENTRY].cmdline_val.l
  814. #define VAR_KBLOCK_PASSWD_COUNT         vars[V_KBLOCK_PASSWD_COUNT].current_val.p
  815. #define USR_KBLOCK_PASSWD_COUNT         vars[V_KBLOCK_PASSWD_COUNT].user_val.p
  816. #define GLO_KBLOCK_PASSWD_COUNT         vars[V_KBLOCK_PASSWD_COUNT].global_val.p
  817. #define FIX_KBLOCK_PASSWD_COUNT         vars[V_KBLOCK_PASSWD_COUNT].fixed_val.p
  818. #define COM_KBLOCK_PASSWD_COUNT         vars[V_KBLOCK_PASSWD_COUNT].cmdline_val.p
  819. #define VAR_STATUS_MSG_DELAY         vars[V_STATUS_MSG_DELAY].current_val.p
  820. #define USR_STATUS_MSG_DELAY         vars[V_STATUS_MSG_DELAY].user_val.p
  821. #define GLO_STATUS_MSG_DELAY         vars[V_STATUS_MSG_DELAY].global_val.p
  822. #define FIX_STATUS_MSG_DELAY         vars[V_STATUS_MSG_DELAY].fixed_val.p
  823. #define COM_STATUS_MSG_DELAY         vars[V_STATUS_MSG_DELAY].cmdline_val.p
  824. #define VAR_SENDMAIL_PATH         vars[V_SENDMAIL_PATH].current_val.p
  825. #define USR_SENDMAIL_PATH         vars[V_SENDMAIL_PATH].user_val.p
  826. #define GLO_SENDMAIL_PATH         vars[V_SENDMAIL_PATH].global_val.p
  827. #define FIX_SENDMAIL_PATH         vars[V_SENDMAIL_PATH].fixed_val.p
  828. #define COM_SENDMAIL_PATH         vars[V_SENDMAIL_PATH].cmdline_val.p
  829. #define VAR_OPER_DIR             vars[V_OPER_DIR].current_val.p
  830. #define USR_OPER_DIR             vars[V_OPER_DIR].user_val.p
  831. #define GLO_OPER_DIR             vars[V_OPER_DIR].global_val.p
  832. #define FIX_OPER_DIR             vars[V_OPER_DIR].fixed_val.p
  833. #define COM_OPER_DIR             vars[V_OPER_DIR].cmdline_val.p
  834. #define VAR_DISPLAY_FILTERS         vars[V_DISPLAY_FILTERS].current_val.l
  835. #define USR_DISPLAY_FILTERS         vars[V_DISPLAY_FILTERS].user_val.l
  836. #define GLO_DISPLAY_FILTERS         vars[V_DISPLAY_FILTERS].global_val.l
  837. #define FIX_DISPLAY_FILTERS         vars[V_DISPLAY_FILTERS].fixed_val.l
  838. #define COM_DISPLAY_FILTERS         vars[V_DISPLAY_FILTERS].cmdline_val.l
  839. #define VAR_SEND_FILTER             vars[V_SEND_FILTER].current_val.l
  840. #define USR_SEND_FILTER             vars[V_SEND_FILTER].user_val.l
  841. #define GLO_SEND_FILTER             vars[V_SEND_FILTER].global_val.l
  842. #define FIX_SEND_FILTER             vars[V_SEND_FILTER].fixed_val.l
  843. #define COM_SEND_FILTER             vars[V_SEND_FILTER].cmdline_val.l
  844. #define VAR_ALT_ADDRS             vars[V_ALT_ADDRS].current_val.l
  845. #define USR_ALT_ADDRS             vars[V_ALT_ADDRS].user_val.l
  846. #define GLO_ALT_ADDRS             vars[V_ALT_ADDRS].global_val.l
  847. #define FIX_ALT_ADDRS             vars[V_ALT_ADDRS].fixed_val.l
  848. #define COM_ALT_ADDRS             vars[V_ALT_ADDRS].cmdline_val.l
  849. #define VAR_ABOOK_FORMATS         vars[V_ABOOK_FORMATS].current_val.l
  850. #define USR_ABOOK_FORMATS         vars[V_ABOOK_FORMATS].user_val.l
  851. #define GLO_ABOOK_FORMATS         vars[V_ABOOK_FORMATS].global_val.l
  852. #define FIX_ABOOK_FORMATS         vars[V_ABOOK_FORMATS].fixed_val.l
  853. #define COM_ABOOK_FORMATS         vars[V_ABOOK_FORMATS].cmdline_val.l
  854. #define VAR_INDEX_FORMAT         vars[V_INDEX_FORMAT].current_val.p
  855. #define USR_INDEX_FORMAT         vars[V_INDEX_FORMAT].user_val.p
  856. #define GLO_INDEX_FORMAT         vars[V_INDEX_FORMAT].global_val.p
  857. #define FIX_INDEX_FORMAT         vars[V_INDEX_FORMAT].fixed_val.p
  858. #define COM_INDEX_FORMAT         vars[V_INDEX_FORMAT].cmdline_val.p
  859. #define VAR_OVERLAP             vars[V_OVERLAP].current_val.p
  860. #define USR_OVERLAP             vars[V_OVERLAP].user_val.p
  861. #define GLO_OVERLAP             vars[V_OVERLAP].global_val.p
  862. #define FIX_OVERLAP             vars[V_OVERLAP].fixed_val.p
  863. #define COM_OVERLAP             vars[V_OVERLAP].cmdline_val.p
  864. #define VAR_MARGIN             vars[V_MARGIN].current_val.p
  865. #define USR_MARGIN             vars[V_MARGIN].user_val.p
  866. #define GLO_MARGIN             vars[V_MARGIN].global_val.p
  867. #define FIX_MARGIN             vars[V_MARGIN].fixed_val.p
  868. #define COM_MARGIN             vars[V_MARGIN].cmdline_val.p
  869. #define VAR_MAILCHECK             vars[V_MAILCHECK].current_val.p
  870. #define USR_MAILCHECK             vars[V_MAILCHECK].user_val.p
  871. #define GLO_MAILCHECK             vars[V_MAILCHECK].global_val.p
  872. #define FIX_MAILCHECK             vars[V_MAILCHECK].fixed_val.p
  873. #define COM_MAILCHECK             vars[V_MAILCHECK].cmdline_val.p
  874. #define VAR_NEWSRC_PATH             vars[V_NEWSRC_PATH].current_val.p
  875. #define USR_NEWSRC_PATH             vars[V_NEWSRC_PATH].user_val.p
  876. #define GLO_NEWSRC_PATH             vars[V_NEWSRC_PATH].global_val.p
  877. #define FIX_NEWSRC_PATH             vars[V_NEWSRC_PATH].fixed_val.p
  878. #define COM_NEWSRC_PATH             vars[V_NEWSRC_PATH].cmdline_val.p
  879. #define VAR_NEWS_ACTIVE_PATH         vars[V_NEWS_ACTIVE_PATH].current_val.p
  880. #define USR_NEWS_ACTIVE_PATH         vars[V_NEWS_ACTIVE_PATH].user_val.p
  881. #define GLO_NEWS_ACTIVE_PATH         vars[V_NEWS_ACTIVE_PATH].global_val.p
  882. #define FIX_NEWS_ACTIVE_PATH         vars[V_NEWS_ACTIVE_PATH].fixed_val.p
  883. #define COM_NEWS_ACTIVE_PATH         vars[V_NEWS_ACTIVE_PATH].cmdline_val.p
  884. #define VAR_NEWS_SPOOL_DIR         vars[V_NEWS_SPOOL_DIR].current_val.p
  885. #define USR_NEWS_SPOOL_DIR         vars[V_NEWS_SPOOL_DIR].user_val.p
  886. #define GLO_NEWS_SPOOL_DIR         vars[V_NEWS_SPOOL_DIR].global_val.p
  887. #define FIX_NEWS_SPOOL_DIR         vars[V_NEWS_SPOOL_DIR].fixed_val.p
  888. #define COM_NEWS_SPOOL_DIR         vars[V_NEWS_SPOOL_DIR].cmdline_val.p
  889.   /* Elm style save is obsolete in Pine 3.81 (see saved msg name rule) */   
  890. #define VAR_ELM_STYLE_SAVE           vars[V_ELM_STYLE_SAVE].current_val.p
  891. #define USR_ELM_STYLE_SAVE           vars[V_ELM_STYLE_SAVE].user_val.p
  892. #define GLO_ELM_STYLE_SAVE           vars[V_ELM_STYLE_SAVE].global_val.p
  893. #define FIX_ELM_STYLE_SAVE           vars[V_ELM_STYLE_SAVE].fixed_val.p
  894. #define COM_ELM_STYLE_SAVE           vars[V_ELM_STYLE_SAVE].cmdline_val.p
  895.   /* Header in reply is obsolete in Pine 3.83 (see feature list) */   
  896. #define VAR_HEADER_IN_REPLY          vars[V_HEADER_IN_REPLY].current_val.p
  897. #define USR_HEADER_IN_REPLY          vars[V_HEADER_IN_REPLY].user_val.p
  898. #define GLO_HEADER_IN_REPLY          vars[V_HEADER_IN_REPLY].global_val.p
  899. #define FIX_HEADER_IN_REPLY          vars[V_HEADER_IN_REPLY].fixed_val.p
  900. #define COM_HEADER_IN_REPLY          vars[V_HEADER_IN_REPLY].cmdline_val.p
  901.   /* Feature level is obsolete in Pine 3.83 (see feature list) */   
  902. #define VAR_FEATURE_LEVEL            vars[V_FEATURE_LEVEL].current_val.p
  903. #define USR_FEATURE_LEVEL            vars[V_FEATURE_LEVEL].user_val.p
  904. #define GLO_FEATURE_LEVEL            vars[V_FEATURE_LEVEL].global_val.p
  905. #define FIX_FEATURE_LEVEL            vars[V_FEATURE_LEVEL].fixed_val.p
  906. #define COM_FEATURE_LEVEL            vars[V_FEATURE_LEVEL].cmdline_val.p
  907.   /* Old style reply is obsolete in Pine 3.83 (see feature list) */   
  908. #define VAR_OLD_STYLE_REPLY          vars[V_OLD_STYLE_REPLY].current_val.p
  909. #define USR_OLD_STYLE_REPLY          vars[V_OLD_STYLE_REPLY].user_val.p
  910. #define GLO_OLD_STYLE_REPLY          vars[V_OLD_STYLE_REPLY].global_val.p
  911. #define FIX_OLD_STYLE_REPLY          vars[V_OLD_STYLE_REPLY].fixed_val.p
  912. #define COM_OLD_STYLE_REPLY          vars[V_OLD_STYLE_REPLY].cmdline_val.p
  913.   /* Compose MIME is obsolete in Pine 3.81 */
  914. #define VAR_COMPOSE_MIME             vars[V_COMPOSE_MIME].current_val.p
  915. #define USR_COMPOSE_MIME             vars[V_COMPOSE_MIME].user_val.p
  916. #define GLO_COMPOSE_MIME             vars[V_COMPOSE_MIME].global_val.p
  917. #define FIX_COMPOSE_MIME             vars[V_COMPOSE_MIME].fixed_val.p
  918. #define COM_COMPOSE_MIME             vars[V_COMPOSE_MIME].cmdline_val.p
  919.   /* Show all characters is obsolete in Pine 3.83 */   
  920. #define VAR_SHOW_ALL_CHARACTERS      vars[V_SHOW_ALL_CHARACTERS].current_val.p
  921. #define USR_SHOW_ALL_CHARACTERS      vars[V_SHOW_ALL_CHARACTERS].user_val.p
  922. #define GLO_SHOW_ALL_CHARACTERS      vars[V_SHOW_ALL_CHARACTERS].global_val.p
  923. #define FIX_SHOW_ALL_CHARACTERS      vars[V_SHOW_ALL_CHARACTERS].fixed_val.p
  924. #define COM_SHOW_ALL_CHARACTERS      vars[V_SHOW_ALL_CHARACTERS].cmdline_val.p
  925.   /* Save by sender is obsolete in Pine 3.83 (see saved msg name rule) */   
  926. #define VAR_SAVE_BY_SENDER           vars[V_SAVE_BY_SENDER].current_val.p
  927. #define USR_SAVE_BY_SENDER           vars[V_SAVE_BY_SENDER].user_val.p
  928. #define GLO_SAVE_BY_SENDER           vars[V_SAVE_BY_SENDER].global_val.p
  929. #define FIX_SAVE_BY_SENDER           vars[V_SAVE_BY_SENDER].fixed_val.p
  930. #define COM_SAVE_BY_SENDER           vars[V_SAVE_BY_SENDER].cmdline_val.p
  931. #define VAR_NNTP_SERVER              vars[V_NNTP_SERVER].current_val.l
  932. #define USR_NNTP_SERVER              vars[V_NNTP_SERVER].user_val.l
  933. #define GLO_NNTP_SERVER              vars[V_NNTP_SERVER].global_val.l
  934. #define FIX_NNTP_SERVER              vars[V_NNTP_SERVER].fixed_val.l
  935. #define COM_NNTP_SERVER              vars[V_NNTP_SERVER].cmdline_val.l
  936. #define VAR_UPLOAD_CMD             vars[V_UPLOAD_CMD].current_val.p
  937. #define USR_UPLOAD_CMD             vars[V_UPLOAD_CMD].user_val.p
  938. #define GLO_UPLOAD_CMD             vars[V_UPLOAD_CMD].global_val.p
  939. #define FIX_UPLOAD_CMD             vars[V_UPLOAD_CMD].fixed_val.p
  940. #define COM_UPLOAD_CMD             vars[V_UPLOAD_CMD].cmdline_val.p
  941. #define VAR_UPLOAD_CMD_PREFIX         vars[V_UPLOAD_CMD_PREFIX].current_val.p
  942. #define USR_UPLOAD_CMD_PREFIX         vars[V_UPLOAD_CMD_PREFIX].user_val.p
  943. #define GLO_UPLOAD_CMD_PREFIX         vars[V_UPLOAD_CMD_PREFIX].global_val.p
  944. #define FIX_UPLOAD_CMD_PREFIX         vars[V_UPLOAD_CMD_PREFIX].fixed_val.p
  945. #define COM_UPLOAD_CMD_PREFIX         vars[V_UPLOAD_CMD_PREFIX].cmdline_val.p
  946. #define VAR_DOWNLOAD_CMD         vars[V_DOWNLOAD_CMD].current_val.p
  947. #define USR_DOWNLOAD_CMD         vars[V_DOWNLOAD_CMD].user_val.p
  948. #define GLO_DOWNLOAD_CMD         vars[V_DOWNLOAD_CMD].global_val.p
  949. #define FIX_DOWNLOAD_CMD         vars[V_DOWNLOAD_CMD].fixed_val.p
  950. #define COM_DOWNLOAD_CMD         vars[V_DOWNLOAD_CMD].cmdline_val.p
  951. #define VAR_DOWNLOAD_CMD_PREFIX         vars[V_DOWNLOAD_CMD_PREFIX].current_val.p
  952. #define USR_DOWNLOAD_CMD_PREFIX         vars[V_DOWNLOAD_CMD_PREFIX].user_val.p
  953. #define GLO_DOWNLOAD_CMD_PREFIX         vars[V_DOWNLOAD_CMD_PREFIX].global_val.p
  954. #define FIX_DOWNLOAD_CMD_PREFIX         vars[V_DOWNLOAD_CMD_PREFIX].fixed_val.p
  955. #define COM_DOWNLOAD_CMD_PREFIX         vars[V_DOWNLOAD_CMD_PREFIX].cmdline_val.p
  956. #define VAR_GOTO_DEFAULT_RULE         vars[V_GOTO_DEFAULT_RULE].current_val.p
  957. #define USR_GOTO_DEFAULT_RULE         vars[V_GOTO_DEFAULT_RULE].user_val.p
  958. #define GLO_GOTO_DEFAULT_RULE         vars[V_GOTO_DEFAULT_RULE].global_val.p
  959. #define FIX_GOTO_DEFAULT_RULE         vars[V_GOTO_DEFAULT_RULE].fixed_val.p
  960. #define COM_GOTO_DEFAULT_RULE         vars[V_GOTO_DEFAULT_RULE].cmdline_val.p
  961. #define VAR_MAILCAP_PATH         vars[V_MAILCAP_PATH].current_val.p
  962. #define USR_MAILCAP_PATH         vars[V_MAILCAP_PATH].user_val.p
  963. #define GLO_MAILCAP_PATH         vars[V_MAILCAP_PATH].global_val.p
  964. #define FIX_MAILCAP_PATH         vars[V_MAILCAP_PATH].fixed_val.p
  965. #define COM_MAILCAP_PATH         vars[V_MAILCAP_PATH].cmdline_val.p
  966. #define VAR_MIMETYPE_PATH         vars[V_MIMETYPE_PATH].current_val.p
  967. #define USR_MIMETYPE_PATH         vars[V_MIMETYPE_PATH].user_val.p
  968. #define GLO_MIMETYPE_PATH         vars[V_MIMETYPE_PATH].global_val.p
  969. #define FIX_MIMETYPE_PATH         vars[V_MIMETYPE_PATH].fixed_val.p
  970. #define COM_MIMETYPE_PATH         vars[V_MIMETYPE_PATH].cmdline_val.p
  971. #define VAR_TCPOPENTIMEO         vars[V_TCPOPENTIMEO].current_val.p
  972. #define USR_TCPOPENTIMEO         vars[V_TCPOPENTIMEO].user_val.p
  973. #define GLO_TCPOPENTIMEO         vars[V_TCPOPENTIMEO].global_val.p
  974. #define FIX_TCPOPENTIMEO         vars[V_TCPOPENTIMEO].fixed_val.p
  975. #define COM_TCPOPENTIMEO         vars[V_TCPOPENTIMEO].cmdline_val.p
  976. #define VAR_RSHOPENTIMEO         vars[V_RSHOPENTIMEO].current_val.p
  977. #define USR_RSHOPENTIMEO         vars[V_RSHOPENTIMEO].user_val.p
  978. #define GLO_RSHOPENTIMEO         vars[V_RSHOPENTIMEO].global_val.p
  979. #define FIX_RSHOPENTIMEO         vars[V_RSHOPENTIMEO].fixed_val.p
  980. #define COM_RSHOPENTIMEO         vars[V_RSHOPENTIMEO].cmdline_val.p
  981. #define VAR_NEW_VER_QUELL         vars[V_NEW_VER_QUELL].current_val.p
  982. #define USR_NEW_VER_QUELL         vars[V_NEW_VER_QUELL].user_val.p
  983. #define GLO_NEW_VER_QUELL         vars[V_NEW_VER_QUELL].global_val.p
  984. #define FIX_NEW_VER_QUELL         vars[V_NEW_VER_QUELL].fixed_val.p
  985. #define COM_NEW_VER_QUELL         vars[V_NEW_VER_QUELL].cmdline_val.p
  986.  
  987. #ifdef    NEWBB
  988. #define VAR_NNTP_NEW_GROUP_TIME      vars[V_NNTP_NEW_GROUP_TIME].current_val.p
  989. #define USR_NNTP_NEW_GROUP_TIME      vars[V_NNTP_NEW_GROUP_TIME].user_val.p
  990. #define GLO_NNTP_NEW_GROUP_TIME      vars[V_NNTP_NEW_GROUP_TIME].global_val.p
  991. #define FIX_NNTP_NEW_GROUP_TIME      vars[V_NNTP_NEW_GROUP_TIME].fixed_val.p
  992. #define COM_NNTP_NEW_GROUP_TIME      vars[V_NNTP_NEW_GROUP_TIME].cmdline_val.p
  993. #endif
  994.  
  995. #if defined(DOS) || defined(OS2)
  996. #define VAR_FOLDER_EXTENSION         vars[V_FOLDER_EXTENSION].current_val.p
  997. #define USR_FOLDER_EXTENSION         vars[V_FOLDER_EXTENSION].user_val.p
  998. #define GLO_FOLDER_EXTENSION         vars[V_FOLDER_EXTENSION].global_val.p
  999. #define FIX_FOLDER_EXTENSION         vars[V_FOLDER_EXTENSION].fixed_val.p
  1000. #define COM_FOLDER_EXTENSION         vars[V_FOLDER_EXTENSION].cmdline_val.p
  1001. #define VAR_NORM_FORE_COLOR         vars[V_NORM_FORE_COLOR].current_val.p
  1002. #define USR_NORM_FORE_COLOR         vars[V_NORM_FORE_COLOR].user_val.p
  1003. #define GLO_NORM_FORE_COLOR         vars[V_NORM_FORE_COLOR].global_val.p
  1004. #define FIX_NORM_FORE_COLOR         vars[V_NORM_FORE_COLOR].fixed_val.p
  1005. #define COM_NORM_FORE_COLOR         vars[V_NORM_FORE_COLOR].cmdline_val.p
  1006. #define VAR_NORM_BACK_COLOR         vars[V_NORM_BACK_COLOR].current_val.p
  1007. #define USR_NORM_BACK_COLOR         vars[V_NORM_BACK_COLOR].user_val.p
  1008. #define GLO_NORM_BACK_COLOR         vars[V_NORM_BACK_COLOR].global_val.p
  1009. #define FIX_NORM_BACK_COLOR         vars[V_NORM_BACK_COLOR].fixed_val.p
  1010. #define COM_NORM_BACK_COLOR         vars[V_NORM_BACK_COLOR].cmdline_val.p
  1011. #define VAR_REV_FORE_COLOR         vars[V_REV_FORE_COLOR].current_val.p
  1012. #define USR_REV_FORE_COLOR         vars[V_REV_FORE_COLOR].user_val.p
  1013. #define GLO_REV_FORE_COLOR         vars[V_REV_FORE_COLOR].global_val.p
  1014. #define FIX_REV_FORE_COLOR         vars[V_REV_FORE_COLOR].fixed_val.p
  1015. #define COM_REV_FORE_COLOR         vars[V_REV_FORE_COLOR].cmdline_val.p
  1016. #define VAR_REV_BACK_COLOR         vars[V_REV_BACK_COLOR].current_val.p
  1017. #define USR_REV_BACK_COLOR         vars[V_REV_BACK_COLOR].user_val.p
  1018. #define GLO_REV_BACK_COLOR         vars[V_REV_BACK_COLOR].global_val.p
  1019. #define FIX_REV_BACK_COLOR         vars[V_REV_BACK_COLOR].fixed_val.p
  1020. #define COM_REV_BACK_COLOR         vars[V_REV_BACK_COLOR].cmdline_val.p
  1021. #ifdef _WINDOWS
  1022. #define VAR_FONT_NAME             vars[V_FONT_NAME].current_val.p
  1023. #define USR_FONT_NAME             vars[V_FONT_NAME].user_val.p
  1024. #define GLO_FONT_NAME             vars[V_FONT_NAME].global_val.p
  1025. #define FIX_FONT_NAME             vars[V_FONT_NAME].fixed_val.p
  1026. #define COM_FONT_NAME             vars[V_FONT_NAME].cmdline_val.p
  1027. #define VAR_FONT_SIZE             vars[V_FONT_SIZE].current_val.p
  1028. #define USR_FONT_SIZE             vars[V_FONT_SIZE].user_val.p
  1029. #define GLO_FONT_SIZE             vars[V_FONT_SIZE].global_val.p
  1030. #define FIX_FONT_SIZE             vars[V_FONT_SIZE].fixed_val.p
  1031. #define COM_FONT_SIZE             vars[V_FONT_SIZE].cmdline_val.p
  1032. #define VAR_FONT_STYLE             vars[V_FONT_STYLE].current_val.p
  1033. #define USR_FONT_STYLE             vars[V_FONT_STYLE].user_val.p
  1034. #define GLO_FONT_STYLE             vars[V_FONT_STYLE].global_val.p
  1035. #define FIX_FONT_STYLE             vars[V_FONT_STYLE].fixed_val.p
  1036. #define COM_FONT_STYLE             vars[V_FONT_STYLE].cmdline_val.p
  1037. #define VAR_PRINT_FONT_NAME         vars[V_PRINT_FONT_NAME].current_val.p
  1038. #define USR_PRINT_FONT_NAME         vars[V_PRINT_FONT_NAME].user_val.p
  1039. #define GLO_PRINT_FONT_NAME         vars[V_PRINT_FONT_NAME].global_val.p
  1040. #define FIX_PRINT_FONT_NAME         vars[V_PRINT_FONT_NAME].fixed_val.p
  1041. #define COM_PRINT_FONT_NAME         vars[V_PRINT_FONT_NAME].cmdline_val.p
  1042. #define VAR_PRINT_FONT_SIZE         vars[V_PRINT_FONT_SIZE].current_val.p
  1043. #define USR_PRINT_FONT_SIZE         vars[V_PRINT_FONT_SIZE].user_val.p
  1044. #define GLO_PRINT_FONT_SIZE         vars[V_PRINT_FONT_SIZE].global_val.p
  1045. #define FIX_PRINT_FONT_SIZE         vars[V_PRINT_FONT_SIZE].fixed_val.p
  1046. #define COM_PRINT_FONT_SIZE         vars[V_PRINT_FONT_SIZE].cmdline_val.p
  1047. #define VAR_PRINT_FONT_STYLE         vars[V_PRINT_FONT_STYLE].current_val.p
  1048. #define USR_PRINT_FONT_STYLE         vars[V_PRINT_FONT_STYLE].user_val.p
  1049. #define GLO_PRINT_FONT_STYLE         vars[V_PRINT_FONT_STYLE].global_val.p
  1050. #define FIX_PRINT_FONT_STYLE         vars[V_PRINT_FONT_STYLE].fixed_val.p
  1051. #define COM_PRINT_FONT_STYLE         vars[V_PRINT_FONT_STYLE].cmdline_val.p
  1052. #define VAR_WINDOW_POSITION         vars[V_WINDOW_POSITION].current_val.p
  1053. #define USR_WINDOW_POSITION         vars[V_WINDOW_POSITION].user_val.p
  1054. #define GLO_WINDOW_POSITION         vars[V_WINDOW_POSITION].global_val.p
  1055. #define FIX_WINDOW_POSITION         vars[V_WINDOW_POSITION].fixed_val.p
  1056. #define COM_WINDOW_POSITION         vars[V_WINDOW_POSITION].cmdline_val.p
  1057. #endif    /* _WINDOWS */
  1058. #endif    /* DOS */
  1059.  
  1060.  
  1061. #define LARGEST_BITMAP 88
  1062. /* Feature list support (can have up to LARGEST_BITMAP features) */
  1063. /* Is feature "feature" turned on? */
  1064. #define F_ON(feature,ps)   (bitnset((feature),(ps)->feature_list))
  1065. #define F_OFF(feature,ps)  (!F_ON(feature,ps))
  1066. #define F_TURN_ON(feature,ps)   (setbitn((feature),(ps)->feature_list))
  1067. #define F_TURN_OFF(feature,ps)  (clrbitn((feature),(ps)->feature_list))
  1068. /* turn off or on depending on value */
  1069. #define F_SET(feature,ps,value) ((value) ? F_TURN_ON((feature),(ps))       \
  1070.                      : F_TURN_OFF((feature),(ps)))
  1071.  
  1072. /* list of feature numbers (which bit goes with which feature) */
  1073. #define F_OLD_GROWTH                0
  1074. #define F_ENABLE_FULL_HDR           1
  1075. #define F_ENABLE_PIPE               2
  1076. #define F_ENABLE_TAB_COMPLETE       3
  1077. #define F_QUIT_WO_CONFIRM           4
  1078. #define F_ENABLE_JUMP               5
  1079. #define F_ENABLE_ALT_ED             6
  1080. #define F_ENABLE_BOUNCE             7
  1081. #define F_ENABLE_AGG_OPS        8
  1082. #define F_ENABLE_FLAG               9
  1083. #define F_CAN_SUSPEND              10
  1084. #define F_EXPANDED_FOLDERS         11
  1085. #define F_USE_FK                   12
  1086. #define F_INCLUDE_HEADER           13
  1087. #define F_SIG_AT_BOTTOM            14
  1088. #define F_DEL_SKIPS_DEL            15
  1089. #define F_AUTO_EXPUNGE             16
  1090. #define F_AUTO_READ_MSGS           17
  1091. #define F_READ_IN_NEWSRC_ORDER     18
  1092. #define F_SELECT_WO_CONFIRM        19
  1093. #define F_USE_CURRENT_DIR          20
  1094. #define F_SAVE_WONT_DELETE         21
  1095. #define F_SAVE_ADVANCES            22
  1096. #define F_FORCE_LOW_SPEED          23
  1097. #define F_ALT_ED_NOW           24
  1098. #define    F_SHOW_DELAY_CUE       25
  1099. #define    F_AUTO_OPEN_NEXT_UNREAD       26
  1100. #define    F_SELECTED_SHOWN_BOLD       27
  1101. #define    F_QUOTE_ALL_FROMS       28
  1102. #define    F_AUTO_INCLUDE_IN_REPLY       29
  1103. #define    F_DISABLE_CONFIG_SCREEN    30
  1104. #define    F_DISABLE_PASSWORD_CMD     31
  1105. #define    F_DISABLE_UPDATE_CMD       32
  1106. #define    F_DISABLE_KBLOCK_CMD       33
  1107. #define    F_DISABLE_SIGEDIT_CMD       34
  1108. #define    F_DISABLE_DFLT_IN_BUG_RPT  35
  1109. #define    F_ATTACHMENTS_IN_REPLY       36
  1110. #define    F_ENABLE_INCOMING       37
  1111. #define    F_NO_NEWS_VALIDATION       38
  1112. #define    F_EXPANDED_ADDRBOOKS       39
  1113. #define    F_QUELL_LOCAL_LOOKUP       40
  1114. #define    F_COMPOSE_TO_NEWSGRP       41
  1115. #define    F_PRESERVE_START_STOP      42
  1116. #define    F_COMPOSE_REJECTS_UNQUAL   43
  1117. #define    F_FAKE_NEW_IN_NEWS       44
  1118. #define    F_SUSPEND_SPAWNS       45
  1119. #define    F_ENABLE_8BIT           46
  1120. #define    F_COMPOSE_MAPS_DEL       47
  1121. #define    F_ENABLE_8BIT_NNTP       48
  1122. #define    F_ENABLE_MOUSE           49
  1123. #define    F_SHOW_CURSOR           50
  1124. #define    F_PASS_CONTROL_CHARS       51
  1125. #define    F_VERT_FOLDER_LIST       52
  1126. #define    F_AUTO_REPLY_TO           53
  1127. #define    F_VERBOSE_POST           54
  1128. #define    F_FCC_ON_BOUNCE           55
  1129. #define    F_USE_SENDER_NOT_X       56
  1130. #define    F_BLANK_KEYMENU           57
  1131. #define    F_CUSTOM_PRINT           58
  1132. #define    F_DEL_FROM_DOT           59
  1133. #define    F_AUTO_ZOOM           60
  1134. #define    F_AUTO_UNZOOM           61
  1135. #define    F_PRINT_INDEX           62
  1136. #define    F_ALLOW_TALK           63
  1137. #define    F_AGG_PRINT_FF           64
  1138. #define    F_ENABLE_DOT_FILES       65
  1139. #define    F_ENABLE_DOT_FOLDERS       66
  1140. #define    F_FIRST_SEND_FILTER_DFLT   67
  1141. #define    F_ALWAYS_LAST_FLDR_DFLT    68
  1142. #define    F_TAB_TO_NEW           69
  1143. #define    F_QUELL_DEAD_LETTER       70
  1144. #define    F_QUELL_BEEPS           71
  1145. #define    F_QUELL_LOCK_FAILURE_MSGS  72
  1146. #define    F_ENABLE_SPACE_AS_TAB       73
  1147. #define    F_ENABLE_TAB_DELETES       74
  1148. #define    F_FLAG_SCREEN_DFLT       75
  1149. #define    F_ENABLE_XTERM_NEWMAIL       76
  1150. #define    F_EXPANDED_DISTLISTS       77
  1151. #define    F_AGG_SEQ_COPY           78
  1152. #define    F_DISABLE_ALARM           79
  1153. #define    F_FROM_DELIM_IN_PRINT       80
  1154. #define    F_BACKGROUND_POST       81
  1155. #define    F_ALLOW_GOTO           82
  1156. #define F_LAST_FEATURE           82         /* RESET WITH NEW FEATURES */
  1157.  
  1158. #if (F_LAST_FEATURE > (LARGEST_BITMAP - 1))
  1159.    Whoa!  Too many features!
  1160. #endif
  1161.  
  1162.  
  1163. /*======================================================================
  1164.        Macros for debug printfs 
  1165.    n is debugging level:
  1166.        1 logs only highest level events and errors
  1167.        2 logs events like file writes
  1168.        3
  1169.        4 logs each command
  1170.        5
  1171.        6 
  1172.        7 logs details of command execution (7 is highest to run any production)
  1173.          allows core dumps without cleaning up terminal modes
  1174.        8
  1175.        9 logs gross details of command execution
  1176.     
  1177.     This is sort of dumb.  The first argument in x is always debugfile, and
  1178.     we're sort of assuming that to be the case below.  However, we don't
  1179.     want to go back and change all of the dprint calls now.
  1180.   ====*/
  1181. #ifdef DEBUG
  1182. #define   dprint(n,x) {                            \
  1183.            if(debugfile && debug >= (n) && do_debug(debugfile))    \
  1184.           fprintf x ;                        \
  1185.           }
  1186. #else
  1187. #define   dprint(n,x)
  1188. #endif
  1189.  
  1190.  
  1191. /*
  1192.  * Status message types
  1193.  */
  1194. #define    SM_DING        0x01            /* ring bell when displayed  */
  1195. #define    SM_ASYNC    0x02            /* display any time         */
  1196. #define    SM_ORDER    0x04            /* ordered, flush on prompt  */
  1197. #define    SM_MODAL    0x08            /* display, wait for user    */
  1198. #define    SM_INFO        0x10            /* Handy, but discardable    */
  1199.  
  1200. /*
  1201.  * Which header fields should format_envelope output?
  1202.  */
  1203. #define    FE_FROM        0x0001
  1204. #define    FE_SENDER    0x0002
  1205. #define    FE_DATE        0x0004
  1206. #define    FE_TO        0x0008
  1207. #define    FE_CC        0x0010
  1208. #define    FE_BCC        0x0020
  1209. #define    FE_NEWSGROUPS    0x0040
  1210. #define    FE_SUBJECT    0x0080
  1211. #define    FE_MESSAGEID    0x0100
  1212. #define    FE_REPLYTO    0x0200
  1213. #define    FE_INREPLYTO    0x0400
  1214. #define    FE_DEFAULT    (FE_FROM | FE_DATE | FE_TO | FE_CC | FE_BCC \
  1215.              | FE_NEWSGROUPS | FE_SUBJECT | FE_REPLYTO)
  1216.  
  1217. #define ALL_EXCEPT    "all-except"
  1218.  
  1219.  
  1220. /*
  1221.  * Flags to indicate how much index border to paint
  1222.  */
  1223. #define    INDX_CLEAR    0x01
  1224. #define    INDX_HEADER    0x02
  1225. #define    INDX_FOOTER    0x04
  1226.  
  1227.  
  1228. /*
  1229.  * Flags to indicate context (i.e., folder collection) use
  1230.  */
  1231. #define    CNTXT_PRIME    0x0001            /* primary collection        */
  1232. #define    CNTXT_SECOND    0x0002            /* secondary collection     */
  1233. #define    CNTXT_NEWS    0x0004            /* news group collection    */
  1234. #define    CNTXT_PSEUDO    0x0008            /* fake folder entry exists */
  1235. #define    CNTXT_INCMNG    0x0010            /* inbox collection        */
  1236. #define    CNTXT_SAVEDFLT    0x0020            /* default save collection  */
  1237. #define    CNTXT_PARTFIND    0x0040            /* partial find done        */
  1238. #define    CNTXT_NOFIND    0x0080            /* no find done in context  */
  1239. #define    CNTXT_FINDALL   0x0100                   /* Do a find_all on context */
  1240. #ifdef    NEWBB
  1241. #define    CNTXT_NEWBB     0x0200                   /* New bboards - NNTP only  */
  1242. #endif
  1243.  
  1244.  
  1245. /*
  1246.  * Flags indicating folder collection type
  1247.  */
  1248. #define    FTYPE_LOCAL    0x01            /* Local folders      */
  1249. #define    FTYPE_REMOTE    0x02            /* Remote folders      */
  1250. #define    FTYPE_SHARED    0x04            /* Shared folders      */
  1251. #define FTYPE_BBOARD    0x08            /* Bulletin Board folders */
  1252. #define    FTYPE_OLDTECH    0x10            /* Not accessed via IMAP  */
  1253. #define    FTYPE_ANON    0x20            /* anonymous access       */
  1254.  
  1255.  
  1256. /*
  1257.  * Useful def's to specify interesting flags
  1258.  */
  1259. #define    F_SEEN        0x00000001
  1260. #define    F_UNSEEN    0x00000002
  1261. #define    F_DEL        0x00000004
  1262. #define    F_UNDEL        0x00000008
  1263. #define    F_FLAG        0x00000010
  1264. #define    F_UNFLAG    0x00000020
  1265. #define    F_ANS        0x00000040
  1266. #define    F_UNANS        0x00000080
  1267. #define    F_RECENT    0x00000100
  1268. #define    F_UNRECENT    0x00000200
  1269. #define    F_OR_SEEN    0x00000400
  1270. #define    F_OR_UNSEEN    0x00000800
  1271. #define    F_OR_DEL    0x00001000
  1272. #define    F_OR_UNDEL    0x00002000
  1273. #define    F_OR_FLAG    0x00004000
  1274. #define    F_OR_UNFLAG    0x00008000
  1275. #define    F_OR_ANS    0x00010000
  1276. #define    F_OR_UNANS    0x00020000
  1277. #define    F_OR_RECENT    0x00040000
  1278. #define    F_OR_UNRECENT    0x00080000
  1279.  
  1280.  
  1281. /*
  1282.  * Save message rules.  if these grow, widen pine
  1283.  * struct's save_msg_rule...
  1284.  */
  1285. #define    MSG_RULE_DEFLT            0x00
  1286. #define    MSG_RULE_SENDER            0x01
  1287. #define    MSG_RULE_FROM            0x02
  1288. #define    MSG_RULE_RECIP            0x03
  1289. #define    MSG_RULE_LAST            0x04
  1290. #define    MSG_RULE_NICK_SENDER        0x05
  1291. #define    MSG_RULE_NICK_FROM        0x06
  1292. #define    MSG_RULE_NICK_RECIP        0x07
  1293. #define    MSG_RULE_NICK_SENDER_DEF    0x08
  1294. #define    MSG_RULE_NICK_FROM_DEF        0x09
  1295. #define    MSG_RULE_NICK_RECIP_DEF        0x0A
  1296. #define    MSG_RULE_FCC_SENDER        0x0B
  1297. #define    MSG_RULE_FCC_FROM        0x0C
  1298. #define    MSG_RULE_FCC_RECIP        0x0D
  1299. #define    MSG_RULE_FCC_SENDER_DEF        0x0E
  1300. #define    MSG_RULE_FCC_FROM_DEF        0x0F
  1301. #define    MSG_RULE_FCC_RECIP_DEF        0x10
  1302.  
  1303. /*
  1304.  * Fcc rules.  if these grow, widen pine
  1305.  * struct's fcc_rule...
  1306.  */
  1307. #define    FCC_RULE_DEFLT        0x00
  1308. #define    FCC_RULE_RECIP        0x01
  1309. #define    FCC_RULE_LAST        0x02
  1310. #define    FCC_RULE_NICK        0x03
  1311. #define    FCC_RULE_NICK_RECIP    0x04
  1312. #define    FCC_RULE_CURRENT    0x05
  1313.  
  1314. /*
  1315.  * Addrbook sorting rules.  if these grow, widen pine
  1316.  * struct's ab_sort_rule...
  1317.  */
  1318. #define    AB_SORT_RULE_FULL_LISTS        0x00
  1319. #define    AB_SORT_RULE_FULL          0x01
  1320. #define    AB_SORT_RULE_NICK_LISTS         0x02
  1321. #define    AB_SORT_RULE_NICK         0x03
  1322. #define    AB_SORT_RULE_NONE        0x04
  1323.  
  1324. /*
  1325.  * Goto default rules.
  1326.  */
  1327. #define    GOTO_INBOX_RECENT_CLCTN        0x00
  1328. #define    GOTO_INBOX_FIRST_CLCTN        0x01
  1329. #define    GOTO_LAST_FLDR            0x02
  1330.  
  1331. /*
  1332.  * These are def's to help manage local, private flags pine uses
  1333.  * to maintain it's mapping table (see MSGNO_S def).  The local flags
  1334.  * are actually stored in spare bits in c-client's pre-message
  1335.  * MESSAGECACHE struct.  But they're private, you ask.  Since the flags
  1336.  * are tied to the actual message (independent of the mapping), storing
  1337.  * them in the c-client means we don't have to worry about them during
  1338.  * sorting and such.  See {set,get}_lflags for more on local flags.
  1339.  */
  1340. #define    MN_NONE        0x0000            /* No Pine specific flags  */
  1341. #define    MN_HIDE        0x0001            /* Pine specific hidden    */
  1342. #define    MN_EXLD        0x0002            /* Pine specific excluded  */
  1343. #define    MN_SLCT        0x0004            /* Pine specific selected  */
  1344.  
  1345.  
  1346. /*
  1347.  * Macros to aid hack to turn off talk permission.
  1348.  * Bit 020 is usually used to turn off talk permission, we turn off
  1349.  * 002 also for good measure, since some mesg commands seem to do that.
  1350.  */
  1351. #define    TALK_BIT        020        /* mode bits */
  1352. #define    GM_BIT            002
  1353. #define    TMD_CLEAR        0        /* functions */
  1354. #define    TMD_SET            1
  1355. #define    TMD_RESET        2
  1356. #define    allow_talk(p)        tty_chmod((p), TALK_BIT, TMD_SET)
  1357. #define    disallow_talk(p)    tty_chmod((p), TALK_BIT|GM_BIT, TMD_CLEAR)
  1358.  
  1359.  
  1360. /*
  1361.  * Macros to help set numeric pinerc variables.  Defined here are the 
  1362.  * allowed min and max values as well as the name of the var as it
  1363.  * should be displayed in error messages.
  1364.  */
  1365. #define    SVAR_OVERLAP(ps, n, e)    strtoval((ps)->VAR_OVERLAP,          \
  1366.                      &(n), 0, 20, (e),          \
  1367.                      "Viewer-overlap")
  1368. #define    SVAR_MARGIN(ps, n, e)    strtoval((ps)->VAR_MARGIN,          \
  1369.                      &(n), 0, 20, (e),          \
  1370.                      "Scroll-margin")
  1371. #define    SVAR_FILLCOL(ps, n, e)    strtoval((ps)->VAR_FILLCOL,          \
  1372.                      &(n), 0, MAX_FILLCOL, (e),      \
  1373.                      "Composer-wrap-column")
  1374. #define    SVAR_MSGDLAY(ps, n, e)    strtoval((ps)->VAR_STATUS_MSG_DELAY,      \
  1375.                      &(n), 0, 30, (e),          \
  1376.                     "Status-message-delay")
  1377. #define    SVAR_MAILCHK(ps, n, e)    strtoval((ps)->VAR_MAILCHECK,          \
  1378.                      &(n), 14, 1, (e),          \
  1379.                     "Mail-check-interval")
  1380.  
  1381. /*
  1382.  * [Re]Define signal functions as needed...
  1383.  */
  1384. #ifdef    POSIX_SIGNALS
  1385. /*
  1386.  * Redefine signal call to our wrapper of POSIX sigaction
  1387.  * NOTE: our_unblock gets defined in signals.c
  1388.  */
  1389. #define    signal(SIG,ACT)        posix_signal(SIG,ACT)
  1390. #define    pine_sigunblock(SIG)    posix_sigunblock(SIG)
  1391. #else
  1392. #ifdef    SYSV_SIGNALS
  1393. /*
  1394.  * Redefine signal calls to SYSV style call.
  1395.  */
  1396. #define    signal(SIG,ACT)        sigset(SIG,ACT)
  1397. #define    pine_sigunblock(SIG)    sigrelse(SIG)
  1398. #else
  1399. /*
  1400.  * Good ol' BSD signals.  No unblock required.
  1401.  */
  1402. #define    pine_sigunblock(SIG)
  1403. #endif /* SYSV_SIGNALS */
  1404. #endif /* POSIX_SIGNALS */
  1405.  
  1406.  
  1407. /*======================================================================
  1408.             Various structures that Pine uses
  1409.  ====*/
  1410.  
  1411. struct ttyo {
  1412.     int    screen_rows,
  1413.     screen_cols,
  1414.     header_rows,    /* number of rows for titlebar and whitespace */
  1415.     footer_rows;    /* number of rows for status and keymenu      */
  1416. };
  1417.  
  1418. /*
  1419.  * HEADER_ROWS is always 2.  1 for the titlebar and 1 for the
  1420.  * blank line after the titlebar.  We should probably make it go down
  1421.  * to 0 when the screen shrinks but instead we're just figuring out
  1422.  * if there is enough room by looking at screen_rows.
  1423.  * FOOTER_ROWS is either 3 or 1.  Normally it is 3, 2 for the keymenu plus 1
  1424.  * for the status line.  If the NoKeyMenu command has been given, then it is 1.
  1425.  */
  1426. #define HEADER_ROWS(X) ((X)->ttyo->header_rows)
  1427. #define FOOTER_ROWS(X) ((X)->ttyo->footer_rows)
  1428.  
  1429.  
  1430. /* (0,0) is upper left */
  1431. typedef struct screen_position {
  1432.     int row;
  1433.     int col;
  1434. } Pos;
  1435.  
  1436. typedef enum {SortDate, SortArrival, SortFrom, SortSubject, SortSubject2,
  1437.                 SortTo, SortCc, SortSize, EndofList}   SortOrder;
  1438.  
  1439.  
  1440. /*
  1441.  * This is *the* struct that keeps track of the pine message number to
  1442.  * raw c-client sequence number mappings.  The mapping is necessary
  1443.  * because pine may re-sort or even hide (exclude) c-client numbers
  1444.  * from the displayed list of messages.  See mailindx.c:msgno_* and
  1445.  * the mn_* macros above for how this things gets used.  See
  1446.  * mailcmd.c:pseudo_selected for an explanation of the funny business
  1447.  * going on with the "hilited" field...
  1448.  */
  1449. typedef struct msg_nos {
  1450.     long      *select,                /* selected message array  */
  1451.            sel_cur,                /* current interesting msg */
  1452.            sel_cnt,                /* its size           */
  1453.            sel_size,            /* its size           */
  1454.               *sort,                /* sorted array of msgno's */
  1455.                sort_size,            /* its size           */
  1456.            max_msgno,            /* total messages       */
  1457.            hilited;                /* holder for "current" msg*/
  1458.     SortOrder  sort_order;            /* list's current sort     */
  1459.     unsigned   reverse_sort:1;            /* whether that's reversed */
  1460.     long       flagged_hid,            /* hidden count           */
  1461.            flagged_exld,            /* excluded count       */
  1462.            flagged_tmp;            /* tmp flagged count       */
  1463. } MSGNO_S;
  1464.  
  1465. /*
  1466.  * Flags for the pipe command routines...
  1467.  */
  1468. #define    PIPE_WRITE    0x0001            /* set up pipe for reading */
  1469. #define    PIPE_READ    0x0002            /* set up pipe for reading */
  1470. #define    PIPE_NOSHELL    0x0004            /* don't exec in shell     */
  1471. #define    PIPE_USER    0x0008            /* user mode           */
  1472. #define    PIPE_STDERR    0x0010            /* stderr to child output  */
  1473. #define    PIPE_PROT    0x0020            /* protected mode       */
  1474. #define    PIPE_RESET    0x0040            /* reset terminal mode     */
  1475. #define    PIPE_DESC    0x0080            /* no stdio desc wrapping  */
  1476. #define    PIPE_SILENT    0x0100            /* no screen clear, etc       */
  1477.  
  1478. /*
  1479.  * stucture required for the pipe commands...
  1480.  */
  1481. typedef struct pipe_s {
  1482.     int      pid,                /* child's process id       */
  1483.          mode;                /* mode flags used to open  */
  1484.     SigType  (*hsig)(),                /* previously installed...  */
  1485.          (*isig)(),                /* handlers            */
  1486.          (*qsig)();
  1487.     union {
  1488.     FILE *f;
  1489.     int   d;
  1490.     }         in;                /* input data handle        */
  1491.     union {
  1492.     FILE *f;
  1493.     int   d;
  1494.     }         out;                /* output data handle        */
  1495.     char   **argv,                /* any necessary args        */
  1496.         *args,
  1497.         *tmp;                /* pointer to stuff        */
  1498. #ifdef    _WINDOWS
  1499.     char    *command;                /* command to execute */
  1500. #endif
  1501. } PIPE_S;
  1502.  
  1503.  
  1504. /*------------------------------
  1505.     Stucture to keep track of the various folder collections being
  1506.     dealt with.
  1507.   ----*/
  1508. typedef struct context {
  1509.     char           *context;            /* context string       */
  1510.     char           *label[4];            /* description lines       */
  1511.     char           *nickname;            /* user provided nickname  */
  1512.     char            last_folder[MAXFOLDER+1];    /* last folder used        */
  1513.     void           *folders;            /* folder data             */
  1514.     unsigned short  type;            /* type of collection      */
  1515.     unsigned short  use;            /* use flags for context   */
  1516.     unsigned short  num;            /* context number in list  */
  1517.     int            d_line;            /* display line for labels */
  1518.     struct context *next;            /* next context struct       */
  1519. } CONTEXT_S;
  1520.  
  1521.  
  1522. /*------------------------------
  1523.    Used for displaying as well as
  1524.    keeping track of folders. 
  1525.    Currently about 25 bytes.
  1526.   ----*/
  1527. typedef struct folder {
  1528.     char     prefix[8];                /* news prefix?           */
  1529.     unsigned char   name_len;            /* name length           */
  1530.     unsigned short msg_count;            /* Up to 65,000 messages   */
  1531.     unsigned short unread_count;
  1532.     unsigned short d_col;
  1533.     unsigned short d_line;
  1534.     char     *nickname;                /* folder's short name     */
  1535.     char     name[1];                /* folder's name           */
  1536. } FOLDER_S;
  1537.  
  1538.  
  1539. /*------------------------------
  1540.    Used for index display
  1541.    formatting.
  1542.   ----*/
  1543. typedef enum {iStatus, iFStatus, iMessNo, iDate, iFromTo, iFrom, iTo, iSender,
  1544.         iSize, iDescripSize, iSubject, iNothing} IndexColType;
  1545. typedef enum {AllAuto, Fixed, Percent, WeCalculate, Special} WidthType;
  1546. typedef enum {Left, Right} ColAdj;
  1547.  
  1548. typedef struct col_description {
  1549.     IndexColType ctype;
  1550.     WidthType    wtype;
  1551.     int         req_width;
  1552.     int         width;
  1553.     char    *string;
  1554.     int         actual_length;
  1555.     ColAdj     adjustment;
  1556. } INDEX_COL_S;
  1557.  
  1558.  
  1559. typedef long MsgNo;
  1560.  
  1561. struct variable {
  1562.     char *name;
  1563.     unsigned  is_obsolete:1;    /* variable read in, not written unless set */
  1564.     unsigned  is_used:1;    /* Some variables are disabled              */
  1565.     unsigned  been_written:1;
  1566.     unsigned  is_user:1;
  1567.     unsigned  is_global:1;
  1568.     unsigned  is_list:1;    /* flag indicating variable is a list       */
  1569.     unsigned  is_fixed:1;    /* sys mgr has fixed this variable          */
  1570.     char     *descrip;        /* description                              */
  1571.     union {
  1572.     char *p;        /* pointer to single string value           */
  1573.     char **l;        /* pointer to list of string values         */
  1574.     } current_val;
  1575.     union {
  1576.     char *p;        /* pointer to single string value           */
  1577.     char **l;        /* pointer to list of string values         */
  1578.     } user_val;            /* from pinerc                              */
  1579.     union {
  1580.     char *p;        /* pointer to single string value           */
  1581.     char **l;        /* pointer to list of string values         */
  1582.     } global_val;        /* from default or pine.conf                */
  1583.     union {
  1584.     char *p;        /* pointer to single string value           */
  1585.     char **l;        /* pointer to list of string values         */
  1586.     } fixed_val;        /* fixed value assigned in pine.conf.fixed  */
  1587.     union {
  1588.     char *p;        /* pointer to single string value           */
  1589.     char **l;        /* pointer to list of string values         */
  1590.     } cmdline_val;        /* user typed as cmdline arg                */
  1591. };
  1592.  
  1593.  
  1594.  
  1595. /*
  1596.  * Generic name/value pair structure
  1597.  */
  1598. typedef struct nameval {
  1599.     char *name;            /* the name that goes in the config file */
  1600.     int   value;        /* the internal bit number */
  1601. } NAMEVAL_S;            /* available features in init.c:feat_list */
  1602.  
  1603.  
  1604. typedef struct attachment {
  1605.     char           *description;
  1606.     BODY           *body;
  1607.     unsigned int    can_display:2;
  1608.     unsigned int    use_external_viewer:1;
  1609.     unsigned int    shown:1;
  1610.     char       *number;
  1611.     char            size[25];
  1612. } ATTACH_S;
  1613.  
  1614. /*
  1615.  * Valid flags for can_display field in attachment struct...
  1616.  */
  1617. #define    CD_NOCANDO    0    /* Can't display this type     */
  1618. #define    CD_GOFORIT    1    /* Can display this type       */
  1619. #define    CD_DEFERRED    2    /* haven't queried mailcap yet */
  1620.  
  1621.  
  1622. typedef struct header_line {
  1623.     unsigned long id;                /* header line's uid */
  1624.     char     line[1];                /* header line name  */
  1625. } HLINE_S;
  1626.  
  1627.  
  1628.  
  1629.  
  1630. /*------
  1631.    A key menu has two ways to turn on and off individual items in the menu.
  1632.    If there is a null entry in the key_menu structure for that key, then
  1633.    it is off.  Also, if the passed bitmap has a zero in the position for
  1634.    that key, then it is off.  This means you can usually set all of the
  1635.    bitmaps and only turn them off if you want to kill a key that is normally
  1636.    there otherwise.
  1637.    Each key_menu is an array of keys with a multiple of 12 number of keys.
  1638.   ------*/
  1639. #define BM_SIZE (LARGEST_BITMAP / 8)
  1640. #define BM_MENUS (4)  /* could be as large as (LARGEST_BITMAP / 12) */
  1641. #define _BITCHAR(bit) ((bit) / 8)
  1642. #define _BITBIT(bit) (1 << ((bit) % 8))
  1643. typedef unsigned char bitmap_t[BM_SIZE];
  1644. /* is bit set? */
  1645. #define bitnset(bit,map) (((map)[_BITCHAR(bit)] & _BITBIT(bit)) ? 1 : 0)
  1646. /* set bit */
  1647. #define setbitn(bit,map) ((map)[_BITCHAR(bit)] |= _BITBIT(bit))
  1648. /* clear bit */
  1649. #define clrbitn(bit,map) ((map)[_BITCHAR(bit)] &= ~_BITBIT(bit))
  1650. /* clear entire bitmap */
  1651. #define clrbitmap(map)   memset((void *)(map), 0, (size_t)BM_SIZE)
  1652. /* set entire bitmap */
  1653. #define setbitmap(map)   memset((void *)(map), 0xff, (size_t)BM_SIZE)
  1654. /*------
  1655.   Argument to draw_keymenu().  These are to identify which of the possibly
  1656.   multiple sets of twelve keys should be shown in the keymenu.  That is,
  1657.   a keymenu may have 24 or 36 keys, so that there are 2 or 3 different
  1658.   screens of key menus for that keymenu.  FirstMenu means to use the
  1659.   first twelve, NextTwelve uses the one after the previous one, SameTwelve
  1660.   uses the same one, AParticularTwelve uses the value in the "which"
  1661.   argument to draw_keymenu().
  1662.   ------*/
  1663. typedef enum {FirstMenu, NextTwelve, SameTwelve, AParticularTwelve} OtherMenu;
  1664.  
  1665.  
  1666. /*
  1667.  * Placeholders for keymenu tags used in some ports  (well, only in the 
  1668.  * windows port for now) to turn on commands in the Menu Bar.
  1669.  */
  1670. #ifndef    KS_OSDATAVAR
  1671. #define KS_OSDATAVAR
  1672. #define    KS_OSDATAGET(X)
  1673. #define    KS_OSDATASET(X, Y)
  1674.  
  1675. #define KS_NONE
  1676. #define KS_VIEW
  1677. #define KS_EXPUNGE
  1678. #define KS_ZOOM
  1679. #define KS_SORT
  1680. #define KS_HDRMODE
  1681. #define KS_MAINMENU
  1682. #define KS_FLDRLIST
  1683. #define KS_FLDRINDEX
  1684. #define KS_COMPOSER
  1685. #define KS_PREVPAGE
  1686. #define KS_PREVMSG
  1687. #define KS_NEXTMSG
  1688. #define KS_ADDRBOOK
  1689. #define KS_WHEREIS
  1690. #define KS_PRINT
  1691. #define KS_REPLY
  1692. #define KS_FORWARD
  1693. #define KS_BOUNCE
  1694. #define KS_DELETE
  1695. #define KS_UNDELETE
  1696. #define KS_FLAG
  1697. #define KS_SAVE
  1698. #define KS_EXPORT
  1699. #define KS_TAKEADDR
  1700. #define KS_SELECT
  1701. #define    KS_SELECTCUR
  1702. #define KS_APPLY
  1703. #define KS_POSTPONE
  1704. #define KS_SEND
  1705. #define KS_CANCEL
  1706. #define KS_ATTACH
  1707. #define KS_TOADDRBOOK
  1708. #define KS_READFILE
  1709. #define KS_JUSTIFY
  1710. #define KS_ALTEDITOR
  1711. #define KS_GENERALHELP
  1712. #define KS_SCREENHELP
  1713. #define KS_EXIT
  1714. #define KS_NEXTPAGE
  1715. #define KS_SAVEFILE
  1716. #define KS_CURPOSITION
  1717. #define KS_GOTOFLDR
  1718. #define KS_JUMPTOMSG
  1719. #define KS_RICHHDR
  1720. #define KS_EXITMODE
  1721. #define KS_REVIEW
  1722. #define KS_UNDO
  1723. #define KS_KEYMENU
  1724. #define KS_OPTIONS
  1725. #endif
  1726.  
  1727. /*
  1728.  * In the next iteration we want to move column out of this structure since
  1729.  * it is the only dynamic data here.  That way we should be able to
  1730.  * consolidate some of the static data that initializes the keymenus.
  1731.  */
  1732. struct key {
  1733.     char  *name;            /* the short name */
  1734.     char  *label;            /* the descriptive label */
  1735.     KS_OSDATAVAR            /* slot for port-specific data */
  1736.     short  column;            /* menu col after formatting */
  1737. };
  1738.  
  1739. struct key_menu {
  1740.     unsigned char how_many;        /* how many separate sets of 12      */
  1741.     unsigned char which;        /* which of the sets are we using    */
  1742.     short         width[BM_MENUS];     /* this ought to be of size how_many */
  1743.     struct key     *keys;            /* array of how_many*12 size structs */
  1744.     bitmap_t      bitmap;
  1745. };
  1746.  
  1747. /*
  1748.  * Macro to simplify instantiation of key_menu structs from key structs
  1749.  */
  1750. #define    INST_KEY_MENU(X, Y)    static struct key_menu X = \
  1751.                         {sizeof(Y)/(sizeof(Y[0])*12), \
  1752.                         0, 0, 0, 0, 0, Y}
  1753.  
  1754. /*
  1755.  * used to store system derived user info
  1756.  */
  1757. typedef struct user_info {
  1758.     char *homedir;
  1759.     char *login;
  1760.     char *fullname;
  1761. } USER_S;
  1762.  
  1763. typedef int (*percent_done_t)();    /* returns %done for progress status msg */
  1764.  
  1765. /* used to fake alarm syscall on systems without it */
  1766. #ifndef    ALARM_BLIP
  1767. #define ALARM_BLIP()
  1768. #endif
  1769.  
  1770.  
  1771. /*
  1772.  * Printing control structure
  1773.  */
  1774. typedef struct print_ctrl {
  1775. #ifndef    DOS
  1776.     PIPE_S    *pipe;        /* control struct for pipe to write text */
  1777.     FILE    *fp;        /* file pointer to write printed text into */
  1778.     char    *result;    /* file containing print command's output */
  1779. #endif
  1780. #ifdef    OS2
  1781.     int        ispipe;
  1782. #endif
  1783.     int        err;        /* bit indicating something went awry */
  1784. } PRINT_S;
  1785.  
  1786.  
  1787. /*
  1788.  * Child posting control structure
  1789.  */
  1790. typedef struct post_s {
  1791.     int        pid;        /* proc id of child doing posting */
  1792.     int        status;        /* child's exit status */
  1793.     char       *fcc;        /* fcc we may have copied */
  1794. } POST_S;
  1795.  
  1796.  
  1797.  
  1798.  
  1799. /*----------------------------------------------------------------------
  1800.    This structure sort of takes the place of global variables or perhaps
  1801. is the global variable.  (It can be accessed globally as ps_global.  One
  1802. advantage to this is that as soon as you see a reference to the structure
  1803. you know it is a global variable. 
  1804.    In general it is treated as global by the lower level and utility
  1805. routines, but it is not treated so by the main screen driving routines.
  1806. Each of them receives it as an argument and then sets ps_global to the
  1807. argument they received.  This is sort of with the thought that things
  1808. might be coupled more loosely one day and that Pine might run where there
  1809. is more than one window and more than one instance.  But we haven't kept
  1810. up with this convention very well.
  1811.  ----*/
  1812.   
  1813. struct pine {
  1814.     void       (*next_screen)();    /* See loop at end of main() for how */
  1815.     void       (*prev_screen)();    /* these are used...             */
  1816.     void       (*redrawer)();        /* NULL means stay in current screen */
  1817.  
  1818.     CONTEXT_S   *context_list;        /* list of user defined contexts */
  1819.     CONTEXT_S   *context_current;    /* default open context          */
  1820.     CONTEXT_S   *context_last;        /* most recently open context    */
  1821.  
  1822.     char         inbox_name[MAXFOLDER+1];
  1823.     MAILSTREAM  *inbox_stream;        /* these used when current folder */
  1824.     long         inbox_new_mail_count;    /* is *not* inbox...          */
  1825.     long         inbox_expunge_count;
  1826.     int          inbox_changed;
  1827.     MSGNO_S    *inbox_msgmap;        /* pointer to inbox mapping struct  */
  1828.     
  1829.     MAILSTREAM  *mail_stream;        /* c-client's current folder stream */
  1830.  
  1831.     MSGNO_S     *msgmap;        /* message num mapping into stream  */
  1832.  
  1833.     long         last_msgno_flagged;
  1834.     long         new_mail_count;
  1835.     long         expunge_count;
  1836.     int          mail_box_changed;
  1837.     int          sort_is_deferred;
  1838.     int          unsorted_newmail;
  1839.     char         cur_folder[MAXPATH+1];
  1840.     ATTACH_S    *atmts;
  1841.     int          atmts_allocated;
  1842.     INDEX_COL_S *index_disp_format;
  1843.  
  1844.     char        *folders_dir;
  1845.     unsigned     mangled_footer:1;     /* footer needs repainting */
  1846.     unsigned     mangled_header:1;    /* header needs repainting */
  1847.     unsigned     mangled_body:1;    /* body of screen needs repainting */
  1848.     unsigned     mangled_screen:1;    /* whole screen needs repainting */
  1849.     unsigned     in_init_seq:1;        /* executing initial cmd list */
  1850.     unsigned     save_in_init_seq:1;
  1851.     unsigned     dont_use_init_cmds:1;    /* use keyboard input when true */
  1852.     unsigned     give_fixed_warning:1;    /* warn user about "fixed" vars */
  1853.     unsigned     fix_fixed_warning:1;    /* offer to fix it              */
  1854.     unsigned     unseen_in_view:1;
  1855.     unsigned     show_folders_dir:1;    /* show folders dir path when showing
  1856.                                                    folder names */
  1857.     unsigned     io_error_on_stream:1;    /* last write on mail_stream failed */
  1858.     unsigned     def_sort_rev:1;    /* true if reverse sort is default  */ 
  1859.     unsigned     restricted:1;
  1860.     unsigned     show_dot_names:1;
  1861.     unsigned     nr_mode:1;
  1862.     unsigned     anonymous:1;           /* for now implys nr_mode */
  1863.     unsigned     save_msg_rule:4;
  1864.     unsigned     fcc_rule:3;
  1865.     unsigned     ab_sort_rule:3;
  1866.     unsigned     goto_default_rule:2;
  1867.     unsigned     full_header:1;         /* display full headers */
  1868.     unsigned     orig_use_fkeys:1;
  1869.  
  1870.     unsigned     try_to_create:1;     /* flag to try mail_create during save */
  1871.     unsigned     low_speed:1;         /* Special screen painting 4 low speed */
  1872.     unsigned     dead_inbox:1;
  1873.     unsigned     dead_stream:1;
  1874.     unsigned     noticed_dead_inbox:1;
  1875.     unsigned     noticed_dead_stream:1;
  1876.     unsigned     mm_log_error:1;
  1877.     unsigned     compose_mime:1;
  1878.     unsigned     show_new_version:1;
  1879.     unsigned     pre390:1;        /** temporary!!!! **/
  1880.     unsigned     first_time_user:1;
  1881.     unsigned     outstanding_pinerc_changes:1;
  1882.     unsigned     intr_pending:1;    /* received SIGINT and haven't acted */
  1883.     unsigned     expunge_in_progress:1;    /* don't want to re-enter c-client   */
  1884.     unsigned     readonly_pinerc:1;
  1885.     unsigned     view_all_except:1;
  1886.     bitmap_t     feature_list;       /* a bitmap of all the features */
  1887.     char       **feat_list_back_compat;
  1888.  
  1889.     /*--- Command line flags, modify only on start up ---*/
  1890.     unsigned     start_in_index:1;
  1891.     unsigned     start_entry;
  1892.     unsigned     more_mode:1;
  1893.  
  1894.     unsigned     noshow_error:1;
  1895.     unsigned     noshow_warn:1;
  1896.     unsigned     shown_newmail:1;
  1897.     unsigned     noshow_timeout:1;
  1898.  
  1899.     unsigned     painted_body_on_startup:1;
  1900.     unsigned     painted_footer_on_startup:1;
  1901.     unsigned     open_readonly_on_startup:1;
  1902.  
  1903. #if defined(DOS) || defined(OS2)
  1904.     unsigned     blank_user_id:1;
  1905.     unsigned     blank_personal_name:1;
  1906.     unsigned     blank_user_domain:1;
  1907. #endif
  1908.  
  1909.     unsigned      viewer_overlap:8;
  1910.     unsigned     scroll_margin:8;
  1911.  
  1912.     short     init_context;
  1913.  
  1914.     int         *initial_cmds;         /* cmds to execute on startup */
  1915.     int         *free_initial_cmds;    /* used to free when done */
  1916.  
  1917.     char         c_client_error[300];  /* when nowhow_error is set and PARSE */
  1918.  
  1919.     struct ttyo *ttyo;
  1920.     KBESC_T     *kbesc;
  1921.  
  1922.     USER_S     ui;        /* system derived user info */
  1923.  
  1924.     POST_S      *post;
  1925.  
  1926.     char    *home_dir,
  1927.                 *hostname,    /* Fully qualified hostname */
  1928.                 *localdomain,    /* The (DNS) domain this host resides in */
  1929.                 *userdomain,    /* The per user domain from .pinerc or */
  1930.                 *maildomain,    /* Domain name for most uses */
  1931. #if defined(DOS) || defined(OS2)
  1932.                 *pine_dir,    /* argv[0] as provided by DOS */
  1933. #endif
  1934.                 *pine_conf,    /* Location of global pine.conf */
  1935.                 *pinerc,    /* Location of user's pinerc */
  1936.         *pine_name;    /* name we were invoked under */
  1937.  
  1938.     SortOrder    def_sort,    /* Default sort type */
  1939.          sort_types[20];
  1940.  
  1941.     int          last_expire_year, last_expire_month;
  1942.  
  1943.     int         printer_category;
  1944.  
  1945.     int         status_msg_delay;
  1946.  
  1947.     int         composer_fillcol;
  1948.  
  1949.     char     last_error[500],
  1950.            **init_errs;
  1951.  
  1952.     PRINT_S    *print;
  1953.  
  1954.     struct variable *vars;
  1955. };
  1956.  
  1957.  
  1958. /*------------------------------
  1959.   Structure to pass optionally_enter to tell it what keystrokes
  1960.   are special
  1961.   ----*/
  1962.  
  1963. typedef struct esckey {
  1964.     int  ch;
  1965.     int  rval;
  1966.     char *name;
  1967.     char *label;
  1968. } ESCKEY_S;
  1969.  
  1970. /*
  1971.  * Optionally_enter flags.
  1972.  */
  1973. #define OE_DISALLOW_CANCEL    0x01
  1974. #define OE_ENABLE_QUOTING    0x02
  1975.  
  1976.  
  1977. struct date {
  1978.     int     sec, minute, hour, day, month, 
  1979.      year, hours_off_gmt, min_off_gmt, wkday;
  1980. };
  1981.  
  1982.  
  1983. /*------------------------------
  1984.   Structures and enum used to expand the envelope structure to
  1985.   support user defined headers.
  1986.   ----*/
  1987.  
  1988. typedef enum {FreeText, Address, Fcc, Attachment, Subject} FieldType;
  1989.  
  1990. typedef struct pine_field {
  1991.     char     *name;            /* field's literal name            */
  1992.     FieldType type;            /* field's type                */
  1993.     unsigned  canedit:1;        /* allow editing of this field        */
  1994.     unsigned  writehdr:1;        /* write rfc822 header for field    */
  1995.     unsigned  localcopy:1;        /* copy to fcc or postponed        */
  1996.     unsigned  rcptto:1;            /* send to this if type Address        */
  1997.     ADDRESS **addr;            /* used if type is Address        */
  1998.     char     *scratch;            /* scratch pointer for Address type */
  1999.     char    **text;            /* field's free text form        */
  2000.     char     *textbuf;            /* need to free this when done        */
  2001.     struct headerentry *he;        /* he that goes with this field, a  */
  2002.                     /*   pointer into headerentry array */
  2003.     struct pine_field *next;        /* next pine field            */
  2004. } PINEFIELD;
  2005.  
  2006.  
  2007. typedef struct {
  2008.     ENVELOPE   *env;        /* standard c-client envelope        */
  2009.     PINEFIELD  *local;        /* this is all of the headers        */
  2010.     PINEFIELD  *custom;        /* ptr to start of custom headers    */
  2011.     PINEFIELD **sending_order;    /* array giving writing order of hdrs    */
  2012. } METAENV;
  2013.  
  2014.  
  2015. typedef enum {OpenFolder, SaveMessage, FolderMaint, GetFcc,
  2016.         Subscribe, PostNews} FolderFun;
  2017. typedef enum {MsgIndex, MultiMsgIndex, ZoomIndex} IndexType;
  2018. typedef enum {FolderName, MessageNumber, MsgTextPercent,
  2019.         TextPercent, FileTextPercent} TitleBarType;
  2020. typedef enum {HelpText, MainHelpText, ComposerHelpText, NewsText, MessageText,
  2021.         AttachText, WhoText, NetNewsText, SimpleText,
  2022.         ReviewMsgsText, ViewAbookText, ViewAbookAtt} TextType;
  2023. typedef enum {CharStarStar, CharStar, FileStar,
  2024.         TmpFileStar, PicoText} SourceType;
  2025. typedef enum {GoodTime, BadTime, VeryBadTime, DoItNow} CheckPointTime;
  2026. typedef enum {InLine, QStatus} DetachErrStyle;
  2027.  
  2028. /*
  2029.  * typedefs of generalized filters used by gf_pipe
  2030.  */
  2031. typedef int  (*gf_io_t)();    /* type of get and put char function     */
  2032. typedef void (*filter_t)();    /* type of filters for piping            */
  2033. typedef struct filter_s {    /* type to hold data for filter function */
  2034.     filter_t f;            /* next function in the pipe             */
  2035.     struct filter_s *next;    /* next filter to call                   */
  2036.     long     n;            /* number of chars seen                  */
  2037.     short    f1;        /* flags                                 */
  2038.     short    f2;        /* second place for flags                */
  2039.     unsigned char t;        /* temporary char                        */
  2040.     char     *line;        /* place for temporary storage           */
  2041.     char     *linep;        /* pointer into storage space            */
  2042.     void     *data;        /* misc data pointer             */
  2043.     unsigned char queue[1 + GF_MAXBUF];
  2044.     short      queuein, queueout;
  2045. } FILTER_S;
  2046.  
  2047. /*
  2048.  * typedef used by storage object routines
  2049.  */
  2050.  
  2051. typedef struct store_object {
  2052.     unsigned char *dp;        /* current position in data         */
  2053.     unsigned char *eod;        /* end of current data             */
  2054.     void      *txt;        /* container's data             */
  2055.     unsigned char *eot;        /* end of space alloc'd for data     */
  2056.     int  (*writec) PROTO((int, struct store_object *));
  2057.     int  (*readc) PROTO((unsigned char *, struct store_object *));
  2058.     int  (*puts) PROTO((struct store_object *, char *));
  2059.     fpos_t       used;    /* amount of object in use         */
  2060.     char          *name;    /* optional object name             */
  2061.     SourceType     src;        /* what we're copying into         */
  2062.     short          flags;    /* flags relating to object use         */
  2063. } STORE_S;
  2064.  
  2065. #define    so_writec(c, so)    ((*(so)->writec)((c), (so)))
  2066. #define    so_readc(c, so)        ((*(so)->readc)((c), (so)))
  2067. #define    so_puts(so, s)        ((*(so)->puts)((so), (s)))
  2068.  
  2069.  
  2070. /*
  2071.  * Attribute table where information on embedded formatting and such
  2072.  * is really stored.
  2073.  */
  2074.  
  2075. typedef    enum {Link, LinkTarget} EmbedActions;
  2076.  
  2077. typedef struct atable_s {    /* a stands for either "anchor" or "action" */
  2078.     short     handle;    /* handle for this action */
  2079.     EmbedActions action;    /* type of action indicated */
  2080.     short     len;        /* number of characters in label */
  2081.     unsigned     wasuline:1;    /* previously underlined (not standard bold) */
  2082.     char    *name;        /* pointer to name of action */
  2083.     PARAMETER    *parms;        /* pointer to  necessary data */
  2084.     struct atable_s *next;
  2085. } ATABLE_S;
  2086.  
  2087.  
  2088. #define TAG_EMBED    '\377'    /* Announces embedded data in text string */
  2089. #define    TAG_INVON    '\001'    /* Supported character attributes      */
  2090. #define    TAG_INVOFF    '\002'
  2091. #define    TAG_BOLDON    '\003'
  2092. #define    TAG_BOLDOFF    '\004'
  2093. #define    TAG_ULINEON    '\005'
  2094. #define    TAG_ULINEOFF    '\006'
  2095. #define    TAG_MIN_HANDLE    '\007'    /* indicate's a handle to an action      */
  2096. #define    TAG_MAX_HANDLE    '\377'
  2097.  
  2098.  
  2099. /*
  2100.  * Structures to control flag maintenance screen
  2101.  */
  2102. struct flag_table {
  2103.     char     *name;        /* flag's name string */
  2104.     HelpType  help;        /* help text */
  2105.     long      flag;        /* flag tag (i.e., F_DEL above) */
  2106.     unsigned  set:2;        /* its state (set, unset, unknown) */
  2107.     unsigned  ukn:1;        /* allow unknown state */
  2108. };
  2109.  
  2110. struct flag_screen {
  2111.     char          **explanation;
  2112.     struct flag_table  *flag_table;
  2113. };
  2114.  
  2115.  
  2116. /*
  2117.  * Some defs to help keep flag setting straight...
  2118.  */
  2119. #define    CMD_FLAG_CLEAR    FALSE
  2120. #define    CMD_FLAG_SET    TRUE
  2121. #define    CMD_FLAG_UNKN    2
  2122.  
  2123.  
  2124. /*
  2125.  * Structure and macros to help control format_header_text
  2126.  */
  2127. typedef struct header_s {
  2128.     unsigned type:4;
  2129.     unsigned except:1;
  2130.     union {
  2131.     char **l;        /* list of char *'s */
  2132.     long   b;        /* bit field of header fields (FE_* above) */
  2133.     } h;
  2134. } HEADER_S;
  2135.  
  2136. #define    HD_LIST        1
  2137. #define    HD_BFIELD    2
  2138. #define    HD_INIT(H, L, E, B)    if((L) && (L)[0]){            \
  2139.                     (H)->type = HD_LIST;        \
  2140.                     (H)->except = (E);            \
  2141.                     (H)->h.l = (L);            \
  2142.                 }                    \
  2143.                 else{                    \
  2144.                     (H)->type = HD_BFIELD;        \
  2145.                     (H)->h.b = (B);            \
  2146.                 }
  2147.  
  2148.  
  2149. /*
  2150.  * Macro to help determine when we need to filter out naughty chars
  2151.  * from message index or headers...
  2152.  */
  2153. #define    CAN_DISPLAY(c)    (iscntrl((c) & 0x7f)                \
  2154.              && !(isspace((unsigned char) (c))        \
  2155.                   || (c) == '\016'                \
  2156.                   || (c) == '\017'))
  2157.  
  2158.  
  2159.  
  2160. /*======================================================================
  2161.     Declarations of all the Pine functions.
  2162.  ====*/
  2163.   
  2164. /*-- addrbook.c --*/
  2165. void        addrbook_reset PROTO((void));
  2166. char       *addr_book_bounce PROTO((void));
  2167. char       *addr_book_compose PROTO((char **));
  2168. char       *addr_book_compose_lcc PROTO((char **));
  2169. void        addr_book_screen PROTO((struct pine *));
  2170. int        address_is_us PROTO((ADDRESS *, struct pine *));
  2171. int        address_is_same PROTO((ADDRESS *, ADDRESS *));
  2172. char       *addr_list_string PROTO((ADDRESS *,
  2173.                   char *(*f) PROTO((ADDRESS *, char *)), int));
  2174. char       *addr_string PROTO((ADDRESS *, char *));
  2175. char      **detach_abook_att PROTO ((MAILSTREAM *, long, BODY *, char *));
  2176. char       *simple_addr_string PROTO((ADDRESS *, char *));
  2177. int        build_address PROTO((char *, char **, char **, BUILDER_ARG *));
  2178. int        build_addr_lcc PROTO((char *, char **, char **, BUILDER_ARG *));
  2179. void        cmd_take_addr PROTO((struct pine *, MSGNO_S *, int));
  2180. void        completely_done_with_adrbks PROTO((void));
  2181. ADDRESS    *copyaddr PROTO((ADDRESS *));
  2182. void        just_update_lookup_file PROTO((char *, char *));
  2183. char       *get_fcc PROTO((char *));
  2184. char       *get_fcc_based_on_to PROTO((ADDRESS *));
  2185. char       *get_fcc_from_addr PROTO((ADDRESS *, char *));
  2186. char       *get_nickname_from_addr PROTO((ADDRESS *, char *));
  2187. void        set_last_fcc PROTO((char *));
  2188.  
  2189. /*-- adrbklib.c --*/
  2190. int        percent_abook_saved PROTO((void));
  2191.  
  2192. /*-- args.c --*/
  2193. char        *pine_args PROTO((struct pine *, int, char **, char ***));
  2194.  
  2195. /*--- filter.c ---*/
  2196. STORE_S       *so_get PROTO((SourceType, char *, int));
  2197. void        so_give PROTO((STORE_S **));
  2198. int        so_seek PROTO((STORE_S *, long, int));
  2199. int        so_truncate PROTO((STORE_S *, long));
  2200. int        so_release PROTO((STORE_S *));
  2201. void       *so_text PROTO((STORE_S *));
  2202. void        gf_filter_init PROTO((void));
  2203. char       *gf_pipe PROTO((gf_io_t, gf_io_t));
  2204. long        gf_bytes_piped PROTO(());
  2205. char       *gf_filter PROTO((char *, char *, STORE_S *, gf_io_t, filter_t *));
  2206. void        gf_set_so_readc PROTO((gf_io_t *, STORE_S *));
  2207. void        gf_set_so_writec PROTO((gf_io_t *, STORE_S *));
  2208. void        gf_set_readc PROTO((gf_io_t *, void *, unsigned long, SourceType));
  2209. void        gf_set_writec PROTO((gf_io_t *, void *, unsigned long, \
  2210.                  SourceType));
  2211. int        gf_puts PROTO((char *, gf_io_t));
  2212. void        gf_set_terminal PROTO((gf_io_t));
  2213. void        gf_binary_b64 PROTO((FILTER_S *, int));
  2214. void        gf_b64_binary PROTO((FILTER_S *, int));
  2215. void        gf_qp_8bit PROTO((FILTER_S *, int));
  2216. void        gf_8bit_qp PROTO((FILTER_S *, int));
  2217. void        gf_rich2plain PROTO((FILTER_S *, int));
  2218. void        gf_rich2plain_opt PROTO((int));
  2219. void        gf_enriched2plain PROTO((FILTER_S *, int));
  2220. void        gf_enriched2plain_opt PROTO((int));
  2221. void        gf_html2plain PROTO((FILTER_S *, int));
  2222. void        gf_escape_filter PROTO((FILTER_S *, int));
  2223. void        gf_control_filter PROTO((FILTER_S *, int));
  2224. void        gf_wrap PROTO((FILTER_S *, int));
  2225. void        gf_wrap_filter_opt PROTO((int));
  2226. void        gf_busy PROTO((FILTER_S *, int));
  2227. void        gf_nvtnl_local PROTO((FILTER_S *, int));
  2228. void        gf_local_nvtnl PROTO((FILTER_S *, int));
  2229. void        gf_line_test PROTO((FILTER_S *, int));
  2230. void        gf_line_test_opt PROTO((int (*) PROTO((long, char *))));
  2231. void        gf_prefix PROTO((FILTER_S *, int));
  2232. void        gf_prefix_opt PROTO((char *));
  2233. #if defined(DOS) || defined(OS2)
  2234. void        gf_translate PROTO((FILTER_S *, int));
  2235. void        gf_translate_opt PROTO((unsigned char *, unsigned));
  2236. #endif
  2237.  
  2238. /*--- folder.c ---*/
  2239. void        folder_screen PROTO((struct pine *));
  2240. char       *folders_for_fcc PROTO((char **));
  2241. int        folder_lister PROTO((struct pine *, FolderFun, CONTEXT_S *, \
  2242.              CONTEXT_S **, char *, char ***, CONTEXT_S *, void *));
  2243. #ifdef    NEWBB
  2244. void        mark_folder_as_new PROTO((char *));
  2245. #endif
  2246. char       *pretty_fn PROTO((char *));
  2247. int        folder_exists PROTO((char *, char *));
  2248. int        folder_create PROTO((char *, CONTEXT_S *));
  2249. int        folder_complete PROTO((CONTEXT_S *, char *));
  2250. void        init_folders PROTO((struct pine *));
  2251. CONTEXT_S  *new_context PROTO((char *));
  2252. void        free_folders PROTO(());
  2253. void        free_context PROTO((CONTEXT_S **));
  2254. void       *find_folders PROTO((char *, char *));
  2255. void        find_folders_in_context PROTO((MAILSTREAM **, CONTEXT_S *,char *));
  2256. CONTEXT_S  *default_save_context PROTO((CONTEXT_S *));
  2257. FOLDER_S   *folder_entry PROTO((int, void *));
  2258. FOLDER_S   *new_folder PROTO((char *));
  2259. int        folder_insert PROTO((int, FOLDER_S *, void *));
  2260. int        folder_index PROTO((char *, void *));
  2261. char       *folder_is_nick PROTO((char *, void *));
  2262. char       *next_folder PROTO((MAILSTREAM **, char *, char *,CONTEXT_S *,int));
  2263. void        init_inbox_mapping PROTO((char *, CONTEXT_S *));
  2264. char       *context_string PROTO((char *));
  2265. int        news_build PROTO((char *, char **, char **, BUILDER_ARG *));
  2266. char       *news_group_selector PROTO((char **));
  2267. void        free_newsgrp_cache PROTO(());
  2268.  
  2269. /*-- help.c --*/
  2270. #if defined(DOS) || defined(HELPFILE)
  2271. void        helper PROTO((short, char *title, int)); 
  2272. char      **get_help_text PROTO((short, int *lines)); 
  2273. #else
  2274. void        helper PROTO((char *text[], char *title, int)); 
  2275. #endif
  2276. void        print_all_help PROTO((void));
  2277. void        review_messages PROTO((char *));
  2278. void        add_review_message PROTO((char *));
  2279. void        end_status_review PROTO((void));
  2280.  
  2281. /*-- imap.c --*/
  2282. char       *cached_user_name PROTO((char *));
  2283. void        imap_flush_passwd_cache PROTO(());
  2284. long        pine_tcptimeout PROTO((long));
  2285.  
  2286. /*-- init.c --*/
  2287. void        init_vars PROTO((struct pine *));
  2288. void        free_vars PROTO((struct pine *));
  2289. char       *expand_variables PROTO((char *, char *));
  2290. void        set_current_val PROTO((struct variable *, int, int));
  2291. void        set_feature_list_current_val PROTO((struct variable *));
  2292. int        init_username PROTO((struct pine *));
  2293. int        init_hostname PROTO((struct pine *));  
  2294. int        write_pinerc PROTO((struct pine *));
  2295. int        var_in_pinerc PROTO((char *));
  2296. void        free_pinerc_lines PROTO((void));
  2297. void        dump_global_conf PROTO((void));
  2298. void        dump_new_pinerc PROTO((char *));
  2299. int        set_variable PROTO((int, char *, int));
  2300. int        set_variable_list PROTO((int, char **));
  2301. int        init_mail_dir PROTO((struct pine *));
  2302. void        init_save_defaults PROTO(());
  2303. int        expire_sent_mail PROTO((void));
  2304. char      **parse_list PROTO((char *, int, char **));
  2305. NAMEVAL_S  *feature_list PROTO((int));
  2306. NAMEVAL_S  *save_msg_rules PROTO((int));
  2307. NAMEVAL_S  *fcc_rules PROTO((int));
  2308. NAMEVAL_S  *ab_sort_rules PROTO((int));
  2309. NAMEVAL_S  *goto_rules PROTO((int));
  2310. void        set_old_growth_bits PROTO((struct pine *, int));
  2311. int        test_old_growth_bits PROTO((struct pine *, int));
  2312. void        dump_config PROTO((struct pine *, gf_io_t));
  2313. void        dump_pine_struct PROTO((struct pine *, gf_io_t));
  2314.  
  2315. /*---- mailcap.c ----*/
  2316. char       *mailcap_build_command PROTO((BODY *, char *, int *));
  2317. int        mailcap_can_display PROTO((int, char *, PARAMETER *));
  2318. void        mailcap_free PROTO((void));
  2319. int        set_mime_type_by_extension PROTO((BODY *, char *));
  2320. int        set_mime_extension_by_type PROTO((char *, char *));
  2321.  
  2322. /*---- mailcmd.c ----*/
  2323. int        process_cmd PROTO((struct pine *, MSGNO_S *, int, int,int,int *));
  2324. void        bogus_command PROTO((int, char *));
  2325. char       *broach_folder PROTO((int, int, CONTEXT_S **));
  2326. int        do_broach_folder PROTO((char *, CONTEXT_S *));
  2327. void        visit_folder PROTO((struct pine *, char *, CONTEXT_S *));
  2328. void        expunge_and_close PROTO((MAILSTREAM *, CONTEXT_S *, char *,
  2329.                      char **));
  2330. char       *get_uname PROTO((char *, char *, int));
  2331. char       *build_updown_cmd PROTO((char *, char *, char *, char*));
  2332. int        file_lister PROTO((char *, char *, char *, int, int));
  2333. int        pseudo_selected PROTO((MSGNO_S *));
  2334. void        restore_selected PROTO((MSGNO_S *));
  2335.  
  2336. /*--- mailindx.c ---*/
  2337. void        mail_index_screen PROTO((struct pine *));
  2338. int        index_lister PROTO((struct pine *, CONTEXT_S *, char *, \
  2339.                 MAILSTREAM *, MSGNO_S *));
  2340. void        clear_index_cache PROTO((void));
  2341. void        clear_index_cache_ent PROTO((long));
  2342. int        build_index_cache PROTO((long));
  2343. #ifdef    DOS
  2344. void        flush_index_cache PROTO((void));
  2345. #endif
  2346. long        line_hash PROTO((char *));
  2347. HLINE_S       *build_header_line PROTO((struct pine *, MAILSTREAM *,
  2348.                      MSGNO_S *, long));
  2349. void        init_index_format PROTO((char *, INDEX_COL_S **));
  2350. void        build_header_cache PROTO((void));
  2351. void        redraw_index_body PROTO((void));
  2352. void        do_index_border PROTO((CONTEXT_S *, char *, MAILSTREAM *, \
  2353.                    MSGNO_S *, IndexType, int *, int));
  2354. char       *sort_name PROTO((SortOrder));
  2355. void        sort_current_folder PROTO((int, SortOrder, int));
  2356. int        percent_sorted PROTO((void));
  2357. void        msgno_init PROTO((MSGNO_S **, long));
  2358. void        msgno_add_raw PROTO((MSGNO_S *, long));
  2359. void        msgno_flush_raw PROTO((MSGNO_S *, long));
  2360. int        msgno_in_select PROTO((MSGNO_S *, long));
  2361. long        msgno_in_sort PROTO((MSGNO_S *, long));
  2362. void        msgno_inc PROTO((MAILSTREAM *, MSGNO_S *));
  2363. void        msgno_dec PROTO((MAILSTREAM *, MSGNO_S *));
  2364. void        msgno_include PROTO((MAILSTREAM *, MSGNO_S *));
  2365. void        msgno_exclude PROTO((MAILSTREAM *, MSGNO_S *));
  2366.  
  2367. /*---- mailpart.c ----*/
  2368. void        attachment_screen PROTO((struct pine *, MSGNO_S *));
  2369. char       *detach PROTO((MAILSTREAM *, long, BODY *, char *, long *, \
  2370.               gf_io_t, filter_t *));
  2371. void        save_attachment PROTO((int, long, ATTACH_S *));
  2372. void        pipe_attachment PROTO((long, ATTACH_S *));
  2373. char       *expand_filter_tokens PROTO((char *, ENVELOPE *, char **, char **,
  2374.                     int *));
  2375. char       *filter_session_key PROTO(());
  2376. char       *filter_data_file PROTO((int));
  2377.  
  2378. /*--- mailview.c ---*/
  2379. void        mail_view_screen PROTO((struct pine *));
  2380. void        scrolltool PROTO((void *, char *, TextType, SourceType, \
  2381.                   ATTACH_S *));
  2382. char       *body_type_names PROTO((int));
  2383. char       *type_desc PROTO((int, char *, PARAMETER *, int));
  2384. int        format_message PROTO((long, ENVELOPE *, BODY *, int, gf_io_t));
  2385. int        match_escapes PROTO((char *));
  2386. int        decode_text PROTO((ATTACH_S *, long, gf_io_t, DetachErrStyle,int));
  2387. char       *display_parameters PROTO((PARAMETER *));
  2388. void        display_output_file PROTO((char *, char *, char *));
  2389. char       *xmail_fetchheader_lines PROTO((MAILSTREAM *, long, char **));
  2390. char       *xmail_fetchheader_lines_not PROTO((MAILSTREAM *, long, char **));
  2391. int        format_header_text PROTO((MAILSTREAM *, long, ENVELOPE *,
  2392.                       HEADER_S *, gf_io_t, char *));
  2393. void        format_envelope PROTO((MAILSTREAM *, long, ENVELOPE *, gf_io_t,
  2394.                    long, char *));
  2395.  
  2396. /*--newmail.c --*/
  2397. long        new_mail PROTO((int, int, int));
  2398. int        check_point PROTO((CheckPointTime));
  2399. void        check_point_change PROTO(());
  2400. void        reset_check_point PROTO((void));
  2401. void        zero_new_mail_count PROTO((void));
  2402.  
  2403. /*-- os.c --*/
  2404. int        can_access PROTO((char *, int));
  2405. int        can_access_in_path PROTO((char *, char *, int));
  2406. long        name_file_size PROTO((char *));
  2407. long        fp_file_size PROTO((FILE *));
  2408. time_t        name_file_mtime PROTO((char *));
  2409. time_t        fp_file_mtime PROTO((FILE *));
  2410. void        file_attrib_copy PROTO((char *, char *));
  2411. int        is_writable_dir PROTO((char *));
  2412. int        create_mail_dir PROTO((char *));
  2413. int        rename_file PROTO((char *, char *));
  2414. void        build_path PROTO((char *, char *, char *));
  2415. int        is_absolute_path PROTO((char *));
  2416. char       *last_cmpnt PROTO((char *));
  2417. int        expand_foldername PROTO((char *));
  2418. char       *fnexpand PROTO((char *, int));
  2419. char       *filter_filename PROTO((char *));
  2420. int        cntxt_allowed PROTO((char *));
  2421. long        disk_quota PROTO((char *, int *));
  2422. char       *read_file PROTO((char *));
  2423. FILE       *create_tmpfile PROTO((void));
  2424. char       *temp_nam PROTO((char *, char *));
  2425. void        coredump PROTO((void));
  2426. void        getdomainnames PROTO((char *, int, char *, int));
  2427. int        have_job_control PROTO((void));
  2428. int         stop_process PROTO((void));
  2429. char       *error_description PROTO((int));
  2430. void        get_user_info PROTO((struct user_info *));
  2431. char       *local_name_lookup PROTO((char *));
  2432. int        change_passwd PROTO((void));
  2433. int        mime_can_display PROTO((int, char *, PARAMETER *, int *));
  2434. char       *canonical_name PROTO((char *));
  2435. PIPE_S       *open_system_pipe PROTO((char *, char **, char **, int));
  2436. int        close_system_pipe PROTO((PIPE_S **));
  2437. SigType      (*posix_signal PROTO((int, SigType (*)())))();
  2438. int        posix_sigunblock PROTO((int));
  2439. char       *smtp_command PROTO((char *));
  2440. int        mta_handoff PROTO((METAENV *, BODY *, char *));
  2441. char       *post_handoff PROTO((METAENV *, BODY *, char *));
  2442. void        exec_mailcap_cmd PROTO((char *, char *, int));
  2443. int        exec_mailcap_test_cmd PROTO((char *));
  2444. #ifdef DEBUG
  2445. void        init_debug PROTO((void));
  2446. void        save_debug_on_crash PROTO((FILE *));
  2447. int        do_debug PROTO((FILE *));
  2448. #endif
  2449. #if defined(DOS) || defined(OS2)
  2450. char       *temp_nam_ext PROTO((char *, char *, char *));
  2451. #endif
  2452. #ifdef    DOS
  2453. void       *dos_cache PROTO((MAILSTREAM *, long, long));
  2454. char       *dos_gets PROTO((readfn_t, void *, unsigned long));
  2455. #endif
  2456. #ifdef    _WINDOWS
  2457. void        scroll_setrange PROTO((long max));
  2458. void        scroll_setpos PROTO((long pos));
  2459. long        scroll_getpos PROTO((void));
  2460. long        scroll_getscrollto PROTO((void));
  2461. #endif
  2462. #ifdef    MOUSE
  2463. unsigned long mouse_in_main PROTO((int, int, int));
  2464. #endif
  2465. int        open_printer PROTO((char *));
  2466. void        close_printer PROTO((void));
  2467. int        print_char PROTO((int));
  2468. void        print_text PROTO((char *));
  2469. void        print_text1 PROTO((char *, char *));
  2470. void        print_text2 PROTO((char *, char *, char *));
  2471. void        print_text3 PROTO((char *, char *, char *, char *));
  2472.  
  2473. /*--- other.c ---*/
  2474. int        lock_keyboard PROTO((void));
  2475. void        signature_edit PROTO((char *));
  2476. void        redraw_kl_body PROTO(());
  2477. void        redraw_klocked_body PROTO(());
  2478. void        gripe PROTO((struct pine *));
  2479. void        option_screen PROTO((struct pine *));
  2480. void        flag_maintenance_screen PROTO((struct pine *,
  2481.                        struct flag_screen *));
  2482. void        parse_printer PROTO ((char *, char **, char **, char **,
  2483.                   char **, char **, char **));
  2484. #ifndef DOS
  2485. void        select_printer PROTO((struct pine *));
  2486. #endif
  2487.  
  2488. /*-- pine.c --*/
  2489. void        main_menu_screen PROTO((struct pine *));
  2490. void        show_main_screen PROTO((struct pine *, int, OtherMenu, \
  2491.                     struct key_menu *, int, Pos *));
  2492. void        news_screen PROTO((struct pine *));
  2493. void        quit_screen PROTO((struct pine *));
  2494. long        count_flagged PROTO((MAILSTREAM *, char *));
  2495. void        panic PROTO((char *));
  2496. void        panic1 PROTO((char *, char *));
  2497. MAILSTREAM *same_stream PROTO((char *, MAILSTREAM *));
  2498. MsgNo        first_sorted_flagged PROTO((unsigned long, MAILSTREAM *));
  2499. MsgNo        next_sorted_flagged PROTO((unsigned long, MAILSTREAM *, \
  2500.                        long, int *));
  2501. long        any_lflagged PROTO((MSGNO_S *, int));
  2502. void        dec_lflagged PROTO((MSGNO_S *, int, long));
  2503. int        get_lflag PROTO((MAILSTREAM *, MSGNO_S *, long, int));
  2504. int        set_lflag PROTO((MAILSTREAM *, MSGNO_S *, long, int, int));
  2505. void        warn_other_cmds PROTO(());
  2506. unsigned long pine_gets_bytes PROTO((int));
  2507.      
  2508. /*-- reply.c --*/
  2509. void        reply PROTO((struct pine *));
  2510. void        reply_delimiter PROTO((ENVELOPE *, gf_io_t));
  2511. char       *reply_quote_str PROTO((ENVELOPE *, int));
  2512. void        forward PROTO((struct pine *));
  2513. void        bounce PROTO((struct pine *));
  2514. void        forward_text PROTO((struct pine *, void *, SourceType));
  2515. char       *generate_message_id PROTO((struct pine *));
  2516. ADDRESS    *first_addr PROTO((ADDRESS *));
  2517. char       *get_signature PROTO(());
  2518. char       *signature_path PROTO((char *, char *, size_t));
  2519. ENVELOPE   *copy_envelope PROTO((ENVELOPE *));
  2520. BODY       *copy_body PROTO((BODY *, BODY *));
  2521. PARAMETER  *copy_parameters PROTO((PARAMETER *));
  2522. int        get_body_part_text PROTO((MAILSTREAM *, BODY *, long, char *, \
  2523.                       gf_io_t, char *, char *));
  2524. char       *partno PROTO((BODY *, BODY *));
  2525.  
  2526. /*-- screen.c --*/
  2527. void        format_keymenu PROTO((struct key_menu *, bitmap_t, int, \
  2528.                   OtherMenu, int));
  2529. void        draw_keymenu PROTO((struct key_menu *, bitmap_t, int, int, \
  2530.                 int, OtherMenu, int));
  2531. void        blank_keymenu PROTO((int, int));
  2532. void        draw_cancel_keymenu PROTO((void));
  2533. void        redraw_keymenu PROTO((void));
  2534. void        mark_keymenu_dirty PROTO((void));
  2535. void        mark_titlebar_dirty PROTO((void));
  2536. char       *status_string PROTO((MAILSTREAM *, MESSAGECACHE *));
  2537. char       *format_titlebar PROTO((int *));
  2538. char       *set_titlebar PROTO((char *, MAILSTREAM *, CONTEXT_S *, char *, \
  2539.                 MSGNO_S *, int, TitleBarType, long, long));
  2540. void        push_titlebar_state PROTO(());
  2541. void        pop_titlebar_state PROTO(());
  2542. void        redraw_titlebar PROTO((void));
  2543. void        update_titlebar_message PROTO((void));
  2544. void        update_titlebar_status PROTO((void));
  2545. void        update_titlebar_percent PROTO((long));
  2546. void        update_titlebar_lpercent PROTO((long));
  2547. void        clearfooter PROTO((struct pine *));
  2548. void        end_titlebar PROTO((void));
  2549. void        end_keymenu PROTO((void));
  2550.  
  2551. /*-- send.c --*/
  2552. void        compose_screen PROTO((struct pine *)); 
  2553. void        compose_mail PROTO((char *, char *, gf_io_t));
  2554. void        pine_send PROTO((ENVELOPE *, BODY **, char *, char *, \
  2555.                  long *, char *, char *, char *, void *, int));
  2556. int        pine_simple_send PROTO((ENVELOPE *, BODY **, char *, char *,
  2557.                     char **, int));
  2558. char       *pine_send_status PROTO((int, char *, char *, int *));
  2559. void        phone_home PROTO(());
  2560. void        pine_free_body PROTO((BODY **));
  2561. void        simple_header_parse PROTO((char *, char **, char **));
  2562. int        valid_subject PROTO((char *, char **, char **, BUILDER_ARG *));
  2563. long        flags_for_pico PROTO((struct pine *));
  2564. long        new_mail_for_pico PROTO((int, int));
  2565. int        display_message_for_pico PROTO((int));
  2566. int        upload_msg_to_pico PROTO((char *, long *));
  2567. char       *checkpoint_dir_for_pico PROTO((char *, int));
  2568. void        set_mime_type_by_grope PROTO((BODY *));
  2569. void        resize_for_pico PROTO(());
  2570.  
  2571. /*-- signals.c --*/
  2572. int        busy_alarm PROTO((unsigned, char *, percent_done_t, int));
  2573. void        suspend_busy_alarm PROTO((void));
  2574. void        resume_busy_alarm PROTO((void));
  2575. void        cancel_busy_alarm PROTO((int)); 
  2576. void        fake_alarm_blip PROTO((void));
  2577. void        init_signals PROTO((void));
  2578. void        init_sighup PROTO((void));
  2579. void        end_sighup PROTO((void));
  2580. void        init_sigwinch PROTO((void));
  2581. int        do_suspend PROTO((struct pine *));
  2582. void        fix_windsize PROTO((struct pine *));
  2583. void        end_signals PROTO((int));
  2584. SigType        hup_signal PROTO(());
  2585. SigType        term_signal PROTO(());
  2586. SigType        child_signal PROTO(());
  2587. void        intr_allow PROTO((void));
  2588. void        intr_disallow PROTO((void));
  2589. void        intr_handling_on PROTO((void));
  2590. void        intr_handling_off PROTO((void));
  2591.  
  2592. /*-- status.c --*/
  2593. int        display_message PROTO((int));
  2594. void        d_q_status_message PROTO((void));
  2595. void        q_status_message PROTO(( int, int, int, char *));
  2596. void        q_status_message1 PROTO((int, int, int, char *, void *));
  2597. void        q_status_message2 PROTO((int, int, int, char *, void *, void *));
  2598. void        q_status_message3 PROTO((int, int, int, char *, void *, void *, \
  2599.                      void *));
  2600. void        q_status_message4 PROTO((int, int, int, char *, void *, void *, \
  2601.                      void *, void *));
  2602. void        q_status_message7 PROTO((int, int, int, char *, void *, void *, \
  2603.                      void *, void *, void *, void *, void *));
  2604. int        messages_queued PROTO((long *));
  2605. char       *last_message_queued PROTO((void));
  2606. int        status_message_remaining PROTO((void));
  2607. int        status_message_write PROTO((char *, int));
  2608. void        flush_status_messages PROTO((int));
  2609. void        flush_ordered_messages PROTO((void));
  2610. void        mark_status_dirty PROTO((void));
  2611. void        mark_status_unknown PROTO((void));
  2612. int        want_to PROTO((char *, int, int, HelpType, int, int));
  2613. int        one_try_want_to PROTO((char *, int, int, HelpType, int, int));
  2614. int        radio_buttons PROTO((char *, int, ESCKEY_S *, int, int, HelpType,
  2615.                  int));
  2616.  
  2617. /*-- strings.c --*/
  2618. char       *rplstr PROTO((char *, int, char *));
  2619. void        sqzspaces PROTO((char *));
  2620. void        sqznewlines PROTO((char *));
  2621. void        removing_trailing_white_space PROTO((char *));
  2622. void        removing_leading_white_space PROTO((char *));
  2623. char       *removing_quotes PROTO((char *));
  2624. char       *strclean PROTO((char *));
  2625. int        strucmp PROTO((char *, char *));
  2626. int        struncmp PROTO((char *, char *, int));
  2627. int        in_dir PROTO((char *, char *));
  2628. char       *srchstr PROTO((char *, char *));
  2629. char       *strindex PROTO((char *, int));
  2630. char       *strrindex PROTO((char *, int));
  2631. void        sstrcpy PROTO((char **, char *));
  2632. char       *istrncpy PROTO((char *, char *, int));
  2633. char       *month_abbrev PROTO((int));
  2634. char       *week_abbrev PROTO((int));
  2635. int        month_num PROTO((char *));
  2636. void        parse_date PROTO((char *, struct date *));
  2637. int        compare_dates PROTO((MESSAGECACHE *, MESSAGECACHE *));
  2638. void        convert_to_gmt PROTO((MESSAGECACHE *));
  2639. char       *pretty_command PROTO((int));
  2640. char       *repeat_char PROTO((int, int));
  2641. char       *comatose PROTO((long));
  2642. char       *byte_string PROTO((long));
  2643. char       *enth_string PROTO((int));
  2644. char       *long2string PROTO((long));
  2645. char       *int2string PROTO((int));
  2646. char       *strtoval PROTO((char *, int *, int, int, char *, char *));
  2647. void        get_pair PROTO((char *, char **, char **, int));
  2648. int        read_hex PROTO((char *));
  2649. char       *string_to_cstring PROTO((char *));
  2650. char       *cstring_to_hexstring PROTO((char *));
  2651. char       *bitstrip PROTO((char *));
  2652. unsigned char *rfc1522_decode PROTO((unsigned char *, char *, char **));
  2653. char       *rfc1522_encode PROTO((char *, unsigned char *, char *));
  2654.  
  2655. /*-- ttyin.c--*/
  2656. int        read_char PROTO((int));
  2657. int        read_command PROTO(());
  2658. int        optionally_enter PROTO((char *, int, int, int, int, int, char *, \
  2659.                     ESCKEY_S *, HelpType, unsigned));
  2660. int        init_tty_driver PROTO((struct pine *));
  2661. void        tty_chmod PROTO((struct pine *, int, int));
  2662. void        setup_dflt_esc_seq PROTO((KBESC_T **));
  2663. void        end_tty_driver PROTO((struct pine *));
  2664. int        Raw PROTO((int));
  2665. void        xonxoff_proc PROTO((int));
  2666. void        crlf_proc PROTO((int));
  2667. void        intr_proc PROTO((int));
  2668. void        flush_input PROTO(());
  2669. void        end_keyboard PROTO((int));
  2670. void        init_keyboard PROTO((int));
  2671. int        validatekeys PROTO((int));
  2672. int        key_recorder PROTO((int, int));
  2673.  
  2674. /*-- ttyout.c --*/
  2675. int        get_windsize PROTO((struct ttyo *));
  2676. int        BeginScroll PROTO((int, int));
  2677. void        EndScroll PROTO((void));
  2678. int        ScrollRegion PROTO(( int));
  2679. int        Writechar PROTO((unsigned int, int));
  2680. void        Write_to_screen PROTO((char *));
  2681. void        PutLine0 PROTO((int, int, char *));
  2682. void        PutLine0n8b PROTO((int, int, char *, int));
  2683. void        PutLine1 PROTO((int, int, char *, void *));
  2684. void        PutLine2 PROTO((int, int, char *, void *, void *));
  2685. void        PutLine3 PROTO((int, int, char *, void *, void *, void *));
  2686. void        PutLine4 PROTO((int, int, char *, void *, void *, void *, void *));
  2687. void        PutLine5 PROTO((int, int, char *, void *, void *, void *, void *, \
  2688.                 void *));
  2689. void        CleartoEOLN PROTO((void));
  2690. int        CleartoEOS PROTO((void));
  2691. void        ClearScreen PROTO((void));
  2692. void        ClearLine PROTO((int));
  2693. void        ClearLines PROTO((int, int));
  2694. void        MoveCursor PROTO((int, int));
  2695. void        NewLine PROTO((void));
  2696. int        StartInverse PROTO((void));
  2697. void        EndInverse PROTO((void));
  2698. int        InverseState PROTO((void));
  2699. int        StartUnderline PROTO((void));
  2700. void        EndUnderline PROTO((void));
  2701. int        StartBold PROTO((void));
  2702. void        EndBold PROTO((void));
  2703. int        config_screen PROTO((struct ttyo **, KBESC_T **));
  2704. void        init_screen PROTO((void));
  2705. void        end_screen PROTO((char *));
  2706. void        outchar PROTO((int));
  2707. void        icon_text PROTO((char *));
  2708. void        clear_cursor_pos PROTO((void));
  2709. int        InsertChar PROTO((int));
  2710. int        DeleteChar PROTO((int));
  2711.  
  2712. #define SCREEN_FUN_NULL ((void (*) PROTO((void *)))NULL)
  2713.  
  2714. #endif /* _PINE_INCLUDED */
  2715.